]> git.joonet.de Git - adminer.git/commitdiff
Allow editing rows without unique key and long text
authorJakub Vrana <jakub@vrana.cz>
Wed, 23 Jan 2013 11:55:47 +0000 (03:55 -0800)
committerJakub Vrana <jakub@vrana.cz>
Thu, 31 Jan 2013 07:47:53 +0000 (23:47 -0800)
adminer/select.inc.php

index 6b35e62b803166b3f0c4964d66c7357197bf08c9..1c4f5bdff0aab25ff59a312c275058ef60bb3317 100644 (file)
@@ -332,6 +332,10 @@ if (!$columns) {
                                $unique_array = unique_array($rows[$n], $indexes);
                                $unique_idf = "";
                                foreach ($unique_array as $key => $val) {
+                                       if (strlen($val) > 10) {
+                                               $key = "MD5(" . (strpos($key, '(') ? $key : idf_escape($key)) . ")"; //! columns looking like functions
+                                               $val = md5($val);
+                                       }
                                        $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
                                }
                                echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>"));