Make WordPress Core


Ignore:
Timestamp:
06/08/2006 03:17:01 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
  • trunk/wp-includes/functions-formatting.php

    r3795 r3855  
    522522function zeroise($number,$threshold) { // function to add leading zeros when necessary
    523523    return sprintf('%0'.$threshold.'s', $number);
    524     }
     524}
    525525
    526526
    527527function backslashit($string) {
     528    $string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string);
    528529    $string = preg_replace('/([a-z])/i', '\\\\\1', $string);
    529530    return $string;
Note: See TracChangeset for help on using the changeset viewer.