]> git.joonet.de Git - adminer.git/commitdiff
Don't store files in hidden fields
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sat, 21 Nov 2009 09:08:52 +0000 (09:08 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sat, 21 Nov 2009 09:08:52 +0000 (09:08 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1250 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/auth.inc.php
adminer/include/functions.inc.php

index ff35f69402f9e95f0897886752a849530b2d5802..a5c7d7b6c5c699196fb3f7d3ace42ee210315d80 100644 (file)
@@ -41,9 +41,6 @@ function auth_error($exception = null) {
        $adminer->loginForm($username);
        echo "<p>\n";
        hidden_fields($_POST, array("server", "username", "password")); // expired session
-       foreach ($_FILES as $key => $val) {
-               echo '<input type="hidden" name="files[' . h($key) . ']" value="' . ($val["error"] ? $val["error"] : base64_encode(file_get_contents($val["tmp_name"]))) . '">';
-       }
        echo "<input type='submit' value='" . lang('Login') . "'>\n</form>\n";
        page_footer("auth");
 }
index 60f57800f7dd741c688df78c8dc86d8dd6dbada8..c9b5a1b770a130a923c2ea93bfdb16b0bf8bdf5b 100644 (file)
@@ -296,22 +296,12 @@ function pagination($page) {
        return " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . h(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
 }
 
-/** Get file contents from $_FILES or $_POST["files"]
+/** Get file contents from $_FILES
 * @param string
 * @param bool
-* @return string
+* @return mixed int for error, string otherwise
 */
 function get_file($key, $decompress = false) {
-       // returns int for error, string otherwise
-       $file = $_POST["files"][$key];
-       if (isset($file)) {
-               // get the file from hidden field if the user was logged out
-               $length = strlen($file);
-               if ($length && $length < 4) {
-                       return intval($file);
-               }
-               return base64_decode($file);
-       }
        $file = $_FILES[$key];
        if (!$file || $file["error"]) {
                return $file["error"];