Move clean_url() to functions-formatting.php. #2525
git-svn-id: https://develop.svn.wordpress.org/trunk@3713 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8928035208
commit
2e6f4d8cc2
@ -230,15 +230,6 @@ function wp_delete_comment($comment_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function clean_url( $url ) {
|
||||
if ('' == $url) return $url;
|
||||
$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
|
||||
$url = str_replace(';//', '://', $url);
|
||||
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
|
||||
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
function get_comments_number( $post_id = 0 ) {
|
||||
global $wpdb, $comment_count_cache, $id;
|
||||
$post_id = (int) $post_id;
|
||||
|
@ -1023,4 +1023,13 @@ function wp_richedit_pre($text) {
|
||||
return apply_filters('richedit_pre', $output);
|
||||
}
|
||||
|
||||
function clean_url( $url ) {
|
||||
if ('' == $url) return $url;
|
||||
$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
|
||||
$url = str_replace(';//', '://', $url);
|
||||
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
|
||||
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user