Shorten NUL byte

This commit is contained in:
Jakub Vrana
2012-09-18 10:41:25 -07:00
parent 9a30f14797
commit 2264e09021
2 changed files with 6 additions and 2 deletions

View File

@@ -9,7 +9,11 @@ function add_apo_slashes($s) {
}
function add_quo_slashes($s) {
return addcslashes($s, "\n\r\$\0\"\\");
$return = $s;
$return = addcslashes($return, "\n\r\$\"\\");
$return = preg_replace('~\0(?![0-7])~', '\\\\0', $return);
$return = addcslashes($return, "\0");
return $return;
}
function remove_lang($match) {