Proper unescape. Thanks to Stefan Esser
This commit is contained in:
parent
68f51cd5af
commit
20dce86770
@ -542,10 +542,10 @@ function serendipity_restoreVar(&$source, &$target) {
|
||||
* @return null
|
||||
*/
|
||||
function serendipity_JSsetCookie($name, $value) {
|
||||
$name = strtr($name, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
|
||||
$value = strtr($value, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
|
||||
$name = htmlentities($name);
|
||||
$value = urlencode($value);
|
||||
|
||||
echo '<script type="text/javascript">SetCookie("' . $name . '", "' . $value . '")</script>' . "\n";
|
||||
echo '<script type="text/javascript">SetCookie("' . $name . '", unescape("' . $value . '"))</script>' . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user