]> git.mjollnir.org Git - s9y.git/commitdiff
Proper unescape. Thanks to Stefan Esser
authorgarvinhicking <garvinhicking>
Thu, 5 Oct 2006 14:05:57 +0000 (14:05 +0000)
committergarvinhicking <garvinhicking>
Thu, 5 Oct 2006 14:05:57 +0000 (14:05 +0000)
include/functions_config.inc.php
include/functions_images.inc.php

index 6ccb5953bbdf8c3a7226b15f59bfaf616d1247b3..a644088821a3f76004fa1fe23c1d630977da56fa 100644 (file)
@@ -398,10 +398,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";
 }
 
 /**
index c45e9f0f20c9a7fceae0fdeacc83de513c393ac0..2287881080c3c2fa838df8b9f1717e206463f59c 100644 (file)
@@ -1121,7 +1121,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
     echo serendipity_setFormToken();
     foreach($serendipity['GET'] AS $g_key => $g_val) {
         if ( !is_array($g_val) && $g_key != 'page' ) {
-            echo '<input type="hidden" name="serendipity[' . $g_key . ']" value="' . htmlspecialchars($g_val) . '" />';
+            echo '<input type="hidden" name="serendipity[' . htmlspecialchars($g_key) . ']" value="' . htmlspecialchars($g_val) . '" />';
         }
     }
 ?>