From e715b4553ebc2682f349cbaef3bb7f46b634c0e6 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 25 Sep 2006 02:25:24 +0000 Subject: [PATCH] Fix percent stripping in clean_url. git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4235 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index 53adcf20c4..c5214793c3 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -217,7 +217,9 @@ function wp_delete_comment($comment_id) { function clean_url( $url ) { if ('' == $url) return $url; - $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url); + $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url); + $strip = array('%0d', '%0a'); + $url = str_replace($strip, '', $url); $url = str_replace(';//', '://', $url); $url = (!strstr($url, '://')) ? 'http://'.$url : $url; $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);