Ticket #4570: 4570.diff
File 4570.diff, 1.5 KB (added by , 17 years ago) |
---|
-
wp-includes/formatting.php
677 677 function make_clickable($ret) { 678 678 $ret = ' ' . $ret; 679 679 // in testing, using arrays here was found to be faster 680 $ret = preg_replace_callback('#([\s>])([\w]+?://[\w\ #$%&~/.\-;:=,?@\[\]+]*)#is', '_make_url_clickable_cb', $ret);681 $ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\ #$%&~/.\-;:=,?@\[\]+]*)#is', '_make_web_ftp_clickable_cb', $ret);680 $ret = preg_replace_callback('#([\s>])([\w]+?://[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_url_clickable_cb', $ret); 681 $ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_web_ftp_clickable_cb', $ret); 682 682 $ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret); 683 683 // this one is not in an array because we need it to run last, for cleanup of accidental links within links 684 684 $ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret); … … 1143 1143 $original_url = $url; 1144 1144 1145 1145 if ('' == $url) return $url; 1146 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@() ]|i', '', $url);1146 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()\\x80-\\xff]|i', '', $url); 1147 1147 $strip = array('%0d', '%0a'); 1148 1148 $url = str_replace($strip, '', $url); 1149 1149 $url = str_replace(';//', '://', $url);