mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +02:00
Save memory
This commit is contained in:
@@ -496,10 +496,11 @@ function get_file($key, $decompress = false) {
|
|||||||
: $file["tmp_name"]
|
: $file["tmp_name"]
|
||||||
)); //! may not be reachable because of open_basedir
|
)); //! may not be reachable because of open_basedir
|
||||||
if ($decompress) {
|
if ($decompress) {
|
||||||
if (function_exists("iconv") && ereg("^\xFE\xFF|^\xFF\xFE", $return, $regs)) {
|
$start = substr($return, 0, 3);
|
||||||
|
if (function_exists("iconv") && ereg("^\xFE\xFF|^\xFF\xFE", $start, $regs)) { // not ternary operator to save memory
|
||||||
$return = iconv("utf-16", "utf-8", $return);
|
$return = iconv("utf-16", "utf-8", $return);
|
||||||
} else { // not ternary operator to save memory
|
} elseif ($start == "\xEF\xBB\xBF") { // UTF-8 BOM
|
||||||
$return = ereg_replace("^\xEF\xBB\xBF", "", $return); // UTF-8 BOM
|
$return = substr($return, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
Reference in New Issue
Block a user