Make WordPress Core

Ticket #2774: 2774.diff

File 2774.diff, 1.7 KB (added by mdawaffe, 18 years ago)

backslash numbers too?

  • wp-includes/functions-formatting.php

     
    521521
    522522
    523523function backslashit($string) {
     524        $string = preg_replace('/([0-9])/', '\\\\\\\\\1', $string);
    524525        $string = preg_replace('/([a-z])/i', '\\\\\1', $string);
    525526        return $string;
    526527}
  • wp-includes/functions.php

     
    3232                $dateweekday = $weekday[date('w', $i)];
    3333                $dateweekday_abbrev = $weekday_abbrev[$dateweekday];
    3434                $dateformatstring = ' '.$dateformatstring;
    35                 $dateformatstring = preg_replace("/([^\\\])D/", "\${1}".backslashit($dateweekday_abbrev), $dateformatstring);
    36                 $dateformatstring = preg_replace("/([^\\\])F/", "\${1}".backslashit($datemonth), $dateformatstring);
    37                 $dateformatstring = preg_replace("/([^\\\])l/", "\${1}".backslashit($dateweekday), $dateformatstring);
    38                 $dateformatstring = preg_replace("/([^\\\])M/", "\${1}".backslashit($datemonth_abbrev), $dateformatstring);
     35                $dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit($dateweekday_abbrev), $dateformatstring);
     36                $dateformatstring = preg_replace("/([^\\\])F/", "\\1".backslashit($datemonth), $dateformatstring);
     37                $dateformatstring = preg_replace("/([^\\\])l/", "\\1".backslashit($dateweekday), $dateformatstring);
     38                $dateformatstring = preg_replace("/([^\\\])M/", "\\1".backslashit($datemonth_abbrev), $dateformatstring);
    3939
    4040                $dateformatstring = substr($dateformatstring, 1, strlen($dateformatstring)-1);
    4141        }