WordPress.org

Make WordPress Core

Ticket #2267: fix_percents.diff

File fix_percents.diff, 610 bytes (added by abhay, 15 years ago)

add percent sign to the regular expression replacement in clean_url()

  • trunk/wp-includes/comment-functions.php

     
    214214
    215215function clean_url( $url ) {
    216216        if ('' == $url) return $url;
    217         $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
     217        $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url);
    218218        $url = str_replace(';//', '://', $url);
    219219        $url = (!strstr($url, '://')) ? 'http://'.$url : $url;
    220220        $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);