]> git.joonet.de Git - adminer.git/commitdiff
Use textarea for blob with disabled file uploads
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 9 Nov 2009 14:34:13 +0000 (14:34 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 9 Nov 2009 14:34:13 +0000 (14:34 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1233 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/functions.inc.php

index 999941078c9a839af096e614992ecd8b0d1e18f3..6e4d0d453393726f1d428a3dff5d42987c83ce82 100644 (file)
@@ -448,10 +448,10 @@ function input($field, $value, $function) {
                                $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
                                echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
                        }
-               } elseif (strpos($field["type"], "text") !== false) {
+               } elseif (ereg('binary|blob', $field["type"]) && ini_get("file_uploads")) {
+                       echo "<input type='file' name='$name'$onchange>";
+               } elseif (ereg('text|blob', $field["type"])) {
                        echo "<textarea name='fields[$name]' cols='50' rows='12'$onchange>" . h($value) . '</textarea>';
-               } elseif (ereg('binary|blob', $field["type"])) {
-                       echo (ini_get("file_uploads") ? "<input type='file' name='$name'$onchange>" : lang('File uploads are disabled.'));
                } else {
                        // int(3) is only a display hint
                        $maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
@@ -477,7 +477,7 @@ function process_input($field) {
                return intval($value);
        } elseif ($field["type"] == "set") {
                return array_sum((array) $value);
-       } elseif (ereg('binary|blob', $field["type"])) {
+       } elseif (ereg('binary|blob', $field["type"]) && ini_get("file_uploads")) {
                $file = get_file($idf);
                if (!is_string($file)) {
                        return false; //! report errors