Make WordPress Core


Ignore:
Timestamp:
02/01/2005 08:31:13 AM (22 years ago)
Author:
rboren
Message:

Don't stomp the percent in escaped octets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-formatting.php

    r2178 r2189  
    218218function sanitize_title_with_dashes($title) {
    219219        $title = strip_tags($title);
    220         $title = preg_replace('|%|', '', $title);
     220        // Preserve escaped octets.
     221        $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
     222        // Remove percent signs that are not part of an octet.
     223        $title = str_replace('%', '', $title);
     224        // Restore octets.
     225        $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
     226
    221227        $title = remove_accents($title);
    222228        if (seems_utf8($title)) {
Note: See TracChangeset for help on using the changeset viewer.