Fix #3468882 "UPDATE single row with varchar key: empty where clause", reported by...
authorJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Mon, 27 Feb 2012 23:54:30 +0000 (00:54 +0100)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Mon, 27 Feb 2012 23:54:30 +0000 (00:54 +0100)
display.php

index 62b3821cdd6d2b469c36c6ae7e29c4bfe3d3c2a5..49440b9e3cc8448fbfe09535f08c82f8239ec68a 100644 (file)
@@ -31,7 +31,7 @@
                if (is_array($_REQUEST['key']))
            $key = $_REQUEST['key'];
         else
-           $key = unserialize($_REQUEST['key']);
+           $key = unserialize(urldecode($_REQUEST['key']));
 
                if ($confirm) {
                        $misc->printTrail($_REQUEST['subject']);
                        echo "<input type=\"hidden\" name=\"sortkey\" value=\"", htmlspecialchars($_REQUEST['sortkey']), "\" />\n";
                        echo "<input type=\"hidden\" name=\"sortdir\" value=\"", htmlspecialchars($_REQUEST['sortdir']), "\" />\n";
                        echo "<input type=\"hidden\" name=\"strings\" value=\"", htmlspecialchars($_REQUEST['strings']), "\" />\n";
-                       echo "<input type=\"hidden\" name=\"key\" value=\"", htmlspecialchars(serialize($key)), "\" />\n";
+                       echo "<input type=\"hidden\" name=\"key\" value=\"", htmlspecialchars(urlencode(serialize($key))), "\" />\n";
                        echo "<p>";
                        if (!$error) echo "<input type=\"submit\" name=\"save\" value=\"{$lang['strsave']}\" />\n";
                        echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
                        if (!isset($_POST['nulls'])) $_POST['nulls'] = array();
                        
                        $status = $data->editRow($_POST['table'], $_POST['values'], $_POST['nulls'], 
-                               $_POST['format'], $_POST['types'], unserialize($_POST['key']));
+                               $_POST['format'], $_POST['types'], $key);
                        if ($status == 0)
                                doBrowse($lang['strrowupdated']);
                        elseif ($status == -2)