mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
Add clean_url filter. see #4570
git-svn-id: http://svn.automattic.com/wordpress/trunk@5952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f8d09ad828
commit
788512c881
@ -1074,6 +1074,8 @@ function wp_richedit_pre($text) {
|
||||
}
|
||||
|
||||
function clean_url( $url, $protocols = null ) {
|
||||
$original_url = $url;
|
||||
|
||||
if ('' == $url) return $url;
|
||||
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%]|i', '', $url);
|
||||
$strip = array('%0d', '%0a');
|
||||
@ -1089,7 +1091,8 @@ function clean_url( $url, $protocols = null ) {
|
||||
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
|
||||
if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
|
||||
return '';
|
||||
return $url;
|
||||
|
||||
return apply_filters('clean_url', $url, $original_url);
|
||||
}
|
||||
|
||||
// Borrowed from the PHP Manual user notes. Convert entities, while
|
||||
|
@ -1054,7 +1054,8 @@ function update_term_cache($terms, $taxonomy = '') {
|
||||
//
|
||||
|
||||
function _get_term_hierarchy($taxonomy) {
|
||||
// TODO Make sure taxonomy is hierarchical
|
||||
if ( !is_taxonomy_hierarchical($taxonomy) )
|
||||
return array();
|
||||
$children = get_option("{$taxonomy}_children");
|
||||
if ( is_array($children) )
|
||||
return $children;
|
||||
|
Loading…
Reference in New Issue
Block a user