also escape ? and & in tags

This commit is contained in:
Shish 2020-01-30 21:24:16 +00:00
parent 8651cc0d7a
commit fb80509be9
2 changed files with 8 additions and 0 deletions

View File

@ -473,6 +473,8 @@ function url_escape(?string $input): string
$input = str_replace('^', '^^', $input);
$input = str_replace('/', '^s', $input);
$input = str_replace('\\', '^b', $input);
$input = str_replace('?', '^q', $input);
$input = str_replace('&', '^a', $input);
$input = rawurlencode($input);
return $input;
}

View File

@ -628,6 +628,12 @@ function _decaret(string $str): string
if ($str[$i] == "b") {
$out .= "\\";
}
if ($str[$i] == "q") {
$out .= "?";
}
if ($str[$i] == "a") {
$out .= "&";
}
} else {
$out .= $str[$i];
}