mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Make replacement strings backref safe without using \${1} so as to preserve php <= 4.2 compatible. Props mdawaffe. fixes #2774
git-svn-id: https://develop.svn.wordpress.org/trunk@3855 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -521,10 +521,11 @@ function format_to_post($content) {
|
||||
|
||||
function zeroise($number,$threshold) { // function to add leading zeros when necessary
|
||||
return sprintf('%0'.$threshold.'s', $number);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function backslashit($string) {
|
||||
$string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string);
|
||||
$string = preg_replace('/([a-z])/i', '\\\\\1', $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user