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:
ryan 2006-04-18 04:58:38 +00:00
parent e2baa1d0ab
commit d650991531
2 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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;
}
?>