double-escape backslashes as well as forward

This commit is contained in:
Shish 2010-04-23 03:31:10 +01:00
parent 9e7b1b1e79
commit b7ca52165b

View File

@ -32,6 +32,7 @@ function int_escape($input) {
function url_escape($input) { function url_escape($input) {
$input = str_replace('^', '^^', $input); $input = str_replace('^', '^^', $input);
$input = str_replace('/', '^s', $input); $input = str_replace('/', '^s', $input);
$input = str_replace('\\', '^b', $input);
$input = rawurlencode($input); $input = rawurlencode($input);
return $input; return $input;
} }
@ -803,6 +804,7 @@ function _decaret($str) {
$i++; $i++;
if($str[$i] == "^") $out .= "^"; if($str[$i] == "^") $out .= "^";
if($str[$i] == "s") $out .= "/"; if($str[$i] == "s") $out .= "/";
if($str[$i] == "b") $out .= "\\";
} }
else { else {
$out .= $str[$i]; $out .= $str[$i];