Move clean_url() to functions-formatting.php. #2525
git-svn-id: http://svn.automattic.com/wordpress/trunk@3713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e2baa1d0ab
commit
d650991531
|
@ -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