Ticket #3515: proto.diff
| File proto.diff, 0.9 kB (added by andy, 2 years ago) |
|---|
-
wp-includes/formatting.php
old new 1056 1056 return apply_filters('richedit_pre', $output); 1057 1057 } 1058 1058 1059 function clean_url( $url ) {1059 function clean_url( $url, $protocols = null ) { 1060 1060 if ('' == $url) return $url; 1061 1061 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%]|i', '', $url); 1062 1062 $strip = array('%0d', '%0a'); … … 1064 1064 $url = str_replace(';//', '://', $url); 1065 1065 $url = (!strstr($url, '://')) ? 'http://'.$url : $url; 1066 1066 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1067 if ( !is_array($protocols) ) 1068 $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); 1069 if ( wp_kses_bad_protocol( $url, $protocols ) != $url ) 1070 return ''; 1067 1071 return $url; 1068 1072 } 1069 1073
