Save memory in get_file()

This commit is contained in:
Jakub Vrana 2013-04-28 08:12:21 -07:00
parent d513de4d71
commit 7f05141b89

View file

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