1
0
mirror of https://github.com/Rouji/single_php_filehost.git synced 2025-04-04 16:39:34 +00:00

move warn_config_value into check_config

isn't used anywhere else
This commit is contained in:
Rouji 2021-08-23 00:14:56 +02:00
parent 6471ece220
commit 57e7385ddf

View File

@ -49,21 +49,19 @@ function check_config()
{
global $MAX_FILESIZE;
global $UPLOAD_TIMEOUT;
warn_config_value('upload_max_filesize', "MAX_FILESIZE", $MAX_FILESIZE);
warn_config_value('post_max_size', "MAX_FILESIZE", $MAX_FILESIZE);
warn_config_value('max_input_time', "UPLOAD_TIMEOUT", $UPLOAD_TIMEOUT);
warn_config_value('max_execution_time', "UPLOAD_TIMEOUT", $UPLOAD_TIMEOUT);
}
function warn_config_value($ini_name, $var_name, $var_val)
{
$ini_val = intval(ini_get($ini_name));
if ($ini_val < $var_val)
printf("<pre>Warning: php.ini: %s (%s) set lower than %s (%s)\n</pre>",
$ini_name,
$ini_val,
$var_name,
$var_val);
$warn_config_value = function($ini_name, $var_name, $var_val)
{
$ini_val = intval(ini_get($ini_name));
if ($ini_val < $var_val)
printf("<pre>Warning: php.ini: %s (%s) set lower than %s (%s)\n</pre>",
$ini_name, $ini_val, $var_name, $var_val);
};
$warn_config_value('upload_max_filesize', "MAX_FILESIZE", $MAX_FILESIZE);
$warn_config_value('post_max_size', "MAX_FILESIZE", $MAX_FILESIZE);
$warn_config_value('max_input_time', "UPLOAD_TIMEOUT", $UPLOAD_TIMEOUT);
$warn_config_value('max_execution_time', "UPLOAD_TIMEOUT", $UPLOAD_TIMEOUT);
}
//extract extension from a path (does not include the dot)