]> git.joonet.de Git - adminer.git/commitdiff
Direct return in process_input()
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 11 Jul 2007 11:00:49 +0000 (11:00 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 11 Jul 2007 11:00:49 +0000 (11:00 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@122 7c3ca157-0c34-0410-bff1-cbf682f78f5c

functions.inc.php

index 098b1b76398b883ee961dbb922e195fda72a4917..7d0546a54acfed1dce54a87db8c32894f830ad18 100644 (file)
@@ -294,23 +294,22 @@ function input($name, $field, $value) {
 function process_input($name, $field) {
        global $mysql;
        $name = bracket_escape($name);
-       $return = $_POST["fields"][$name];
-       if (preg_match('~char|text|set|binary|blob~', $field["type"]) ? $_POST["null"][$name] : !strlen($return)) {
-               $return = "NULL";
+       $value = $_POST["fields"][$name];
+       if (preg_match('~char|text|set|binary|blob~', $field["type"]) ? $_POST["null"][$name] : !strlen($value)) {
+               return "NULL";
        } elseif ($field["type"] == "enum") {
-               $return = (isset($_GET["default"]) ? "'" . $mysql->escape_string($return) . "'" : intval($return));
+               return (isset($_GET["default"]) ? "'" . $mysql->escape_string($value) . "'" : intval($value));
        } elseif ($field["type"] == "set") {
-               $return = (isset($_GET["default"]) ? "'" . implode(",", array_map(array($mysql, 'real_escape_string'), (array) $return)) . "'" : array_sum((array) $return));
+               return (isset($_GET["default"]) ? "'" . implode(",", array_map(array($mysql, 'real_escape_string'), (array) $value)) . "'" : array_sum((array) $value));
        } elseif (preg_match('~binary|blob~', $field["type"])) {
                $file = get_file($name);
                if (!is_string($file) && !$field["null"]) {
                        return false; //! report errors, also empty $_POST (too big POST data, not only FILES)
                }
-               $return = "_binary'" . (is_string($file) ? $mysql->escape_string($file) : "") . "'";
+               return "_binary'" . (is_string($file) ? $mysql->escape_string($file) : "") . "'";
        } else {
-               $return = "'" . $mysql->escape_string($return) . "'";
+               return "'" . $mysql->escape_string($value) . "'";
        }
-       return $return;
 }
 
 if (get_magic_quotes_gpc()) {