Make WordPress Core


Ignore:
Timestamp:
06/08/2006 03:21:04 AM (19 years ago)
Author:
ryan
Message:

Make replacement strings backref safe without using \${1} so as to preserve php <= 4.2 compatible. Props mdawaffe. fixes #2774

File:
1 edited

Legend:

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

    r3794 r3856  
    518518function zeroise($number,$threshold) { // function to add leading zeros when necessary
    519519    return sprintf('%0'.$threshold.'s', $number);
    520     }
     520}
    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;
Note: See TracChangeset for help on using the changeset viewer.