]> git.joonet.de Git - adminer.git/commitdiff
Allow '' in enum
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 29 Aug 2008 09:10:31 +0000 (09:10 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 29 Aug 2008 09:10:31 +0000 (09:10 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@464 7c3ca157-0c34-0410-bff1-cbf682f78f5c

editing.inc.php

index cd64dc9aa134499cec6fd9fc80547d505cae6cda..0dce0d208d5cee4baec85e752ff301bdcc9eb6f0 100644 (file)
@@ -11,12 +11,12 @@ function input($name, $field, $value) {
                foreach ($matches[1] as $i => $val) {
                        $val = stripcslashes(str_replace("''", "'", $val));
                        $id = "field-$name-" . ($i+1);
-                       $checked = (is_int($value) ? $value == $i+1 : $value === $val); //! '' collide with NULL in $_GET["default"]
-                       echo ' <label for="' . $id . '"><input type="radio" name="fields[' . $name . ']" id="' . $id . '" value="' . (isset($_GET["default"]) ? htmlspecialchars($val) : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . ' />' . htmlspecialchars($val) . '</label>';
+                       $checked = (is_int($value) ? $value == $i+1 : $value === $val);
+                       echo ' <label for="' . $id . '"><input type="radio" name="fields[' . $name . ']" id="' . $id . '" value="' . (isset($_GET["default"]) ? (strlen($val) ? htmlspecialchars($val) : " ") : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . ' />' . htmlspecialchars($val) . '</label>';
                }
                if ($field["null"]) {
                        $id = "field-$name-";
-                       echo ' <label for="' . $id . '"><input type="radio" name="fields[' . $name . ']" id="' . $id . '" value=""' . (strlen($value) ? '' : ' checked="checked"') . ' />' . lang('NULL') . '</label>';
+                       echo ' <label for="' . $id . '"><input type="radio" name="fields[' . $name . ']" id="' . $id . '" value=""' . (isset($value) ? '' : ' checked="checked"') . ' />' . lang('NULL') . '</label>';
                }
        } elseif ($field["type"] == "set") { //! 64 bits
                preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);