Ticket #7386: 7386.002.diff
| File 7386.002.diff, 1.1 KB (added by , 18 years ago) |
|---|
-
wp-includes/formatting.php
1147 1147 $original_url = $url; 1148 1148 1149 1149 if ('' == $url) return $url; 1150 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@ ()\\x80-\\xff]|i', '', $url);1150 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$*\'()\\x80-\\xff]|i', '', $url); 1151 1151 $strip = array('%0d', '%0a'); 1152 1152 $url = str_replace($strip, '', $url); 1153 1153 $url = str_replace(';//', '://', $url); … … 1159 1159 substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) 1160 1160 $url = 'http://' . $url; 1161 1161 1162 // Replace ampersands ony when displaying.1163 if ( 'display' == $context ) 1162 // Replace ampersands and single quotes ony when displaying. 1163 if ( 'display' == $context ) { 1164 1164 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1165 $url = str_replace( "'", ''', $url ); 1166 } 1165 1167 1166 1168 if ( !is_array($protocols) ) 1167 1169 $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');