Fix maxFileSize

This commit is contained in:
cmp167
2023-09-10 04:07:23 +12:00
parent 42bba9d1be
commit 6ee83b4b82

View File

@@ -8,6 +8,7 @@
var $gitCommit = ""; var $gitCommit = "";
var $gitComment = ""; var $gitComment = "";
var $maxFileSize = 104856;
function toArray($obj) { function toArray($obj) {
$re = array(); $re = array();
@@ -145,11 +146,11 @@
function readFile($file) { function readFile($file) {
return @file_get_contents( return @file_get_contents(
$file , // string $file , // string
false , // bool $use_include_path false , // bool $use_include_path
null , // ?resource $context null , // ?resource $context
0 , // int $offset 0 , // int $offset
$this->parm["maxFileSize"] , // ?int $length $this->maxFileSize , // ?int $length
); );
} }
@@ -198,9 +199,21 @@
date_default_timezone_set($this->parm["timezone"]); date_default_timezone_set($this->parm["timezone"]);
} }
if(!@$this->parm["maxFileSize"]) do {
$this->parm["maxFileSize"] = 1048576; if(!isset($this->parm["maxFileSize"]))
$this->d("Set maxFileSize '" . $this->parm["maxFileSize"] . "'"); break;
if(!$this->parm["maxFileSize"])
break;
if(!is_numeric($this->parm["maxFileSize"])) {
$this->d("Not numeric maxFileSize");
break;
}
$this->maxFileSize = 1*$this->parm["maxFileSize"];
$this->d("Set maxFileSize '" . $this->maxFileSize . "'");
} while(0);
if(isset($this->parm["php_ini"]) && is_array($this->parm["php_ini"])) { if(isset($this->parm["php_ini"]) && is_array($this->parm["php_ini"])) {
foreach($this->parm["php_ini"] as $k => $v) { foreach($this->parm["php_ini"] as $k => $v) {