Make WordPress Core

Ticket #16859: patch16859.diff

File patch16859.diff, 577 bytes (added by edwardw, 13 years ago)

[PATCH] Urlencode brackets when cleaning

  • wp-includes/formatting.php

     
    22462246
    22472247        if ( '' == $url )
    22482248                return $url;
     2249               
     2250        // Preserve parentheses and square brackets     - see #16859
     2251        $url = str_replace( Array('(',')','[',']'), Array('%28','%29','%5B','%5D'), $url );
     2252       
    22492253        $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
    22502254        $strip = array('%0d', '%0a', '%0D', '%0A');
    22512255        $url = _deep_replace($strip, $url);