diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 3a48c2684b..caf2c53439 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -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 diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index d772b388de..ba136ad72a 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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;