Skip to content

Commit 732dda9

Browse files
committed
Fix percent stripping in clean_url.
git-svn-id: https://develop.svn.wordpress.org/trunk@4148 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5d22669 commit 732dda9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

wp-includes/formatting.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,9 @@ function wp_richedit_pre($text) {
10371037

10381038
function clean_url( $url ) {
10391039
if ('' == $url) return $url;
1040-
$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
1040+
$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url);
1041+
$strip = array('%0d', '%0a');
1042+
$url = str_replace($strip, '', $url);
10411043
$url = str_replace(';//', '://', $url);
10421044
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
10431045
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);

0 commit comments

Comments
 (0)