From 57e7385ddff979d1827faf9d4ff603bc25748903 Mon Sep 17 00:00:00 2001 From: Rouji Date: Mon, 23 Aug 2021 00:14:56 +0200 Subject: [PATCH] move warn_config_value into check_config isn't used anywhere else --- index.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index f6eaeba..7cf0005 100755 --- a/index.php +++ b/index.php @@ -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("
Warning: php.ini: %s (%s) set lower than %s (%s)\n
", - $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("
Warning: php.ini: %s (%s) set lower than %s (%s)\n
", + $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)