]> git.joonet.de Git - adminer.git/commitdiff
Save memory in get_file()
authorJakub Vrana <jakub@vrana.cz>
Sun, 28 Apr 2013 15:12:21 +0000 (08:12 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sun, 28 Apr 2013 15:17:50 +0000 (08:17 -0700)
adminer/include/functions.inc.php

index ade083f3923d9b8d0061c2f1525be8f43be4b7b6..872ed5066ae2fe6f8110beb65eb63dd01fb4c191 100644 (file)
@@ -595,7 +595,7 @@ function get_file($key, $decompress = false) {
        foreach ($file as $key => $val) {
                $file[$key] = (array) $val;
        }
-       $return = array();
+       $return = '';
        foreach ($file["error"] as $key => $error) {
                if ($error) {
                        return $error;
@@ -614,10 +614,10 @@ function get_file($key, $decompress = false) {
                                $content = substr($content, 3);
                        }
                }
-               $return[] = $content;
+               $return .= $content . "\n\n";
        }
        //! support SQL files not ending with semicolon
-       return implode("\n\n\n", $return);
+       return $return;
 }
 
 /** Determine upload error