WordPress.org

Make WordPress Core

Ticket #4570: 4570.diff

File 4570.diff, 1.5 KB (added by guillep2k, 6 years ago)
  • wp-includes/formatting.php

     
    677677function make_clickable($ret) { 
    678678        $ret = ' ' . $ret; 
    679679        // 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); 
    682682        $ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret); 
    683683        // this one is not in an array because we need it to run last, for cleanup of accidental links within links 
    684684        $ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret); 
     
    11431143        $original_url = $url; 
    11441144 
    11451145        if ('' == $url) return $url; 
    1146         $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()]|i', '', $url); 
     1146        $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()\\x80-\\xff]|i', '', $url); 
    11471147        $strip = array('%0d', '%0a'); 
    11481148        $url = str_replace($strip, '', $url); 
    11491149        $url = str_replace(';//', '://', $url);