relax "disabled functions" check

This commit is contained in:
Pig Fang 2020-08-29 10:09:53 +08:00
parent 81a343dd56
commit f6971892a3
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2

View File

@ -29,12 +29,16 @@ ini_set('display_errors', true);
file_put_contents($envPath, preg_replace('/APP_KEY\s*=\s*/', 'APP_KEY='.$key."\n\n", $envFile));
}
if (!empty(ini_get('disable_functions'))) {
die_with_utf8_encoding(
'[Error] Please don\'t disable any functions, which is specified in "php.ini" file.<br>'.
'[错误] 请不要在 php.ini 中禁用任何函数。'.
'<strong>我们不建议使用您使用宝塔等面板软件,因为容易引起兼容性问题。</strong>'
);
$requiredFunctions = ['symlink', 'readlink', 'putenv', 'realpath'];
$disabledFunctions = preg_split('/,\s*/', ini_get('disable_functions'));
foreach ($requiredFunctions as $fn) {
if (in_array($fn, $disabledFunctions)) {
die_with_utf8_encoding(
'[Error] Please don\'t disable built-in function "'.$fn.'", which is specified in "php.ini" file.<br>'.
"[错误] 请不要在 php.ini 中禁用 $fn 函数。".
'<strong>我们不建议使用您使用宝塔等面板软件,因为容易引起兼容性问题。</strong>'
);
}
}
if (!empty(ini_get('open_basedir'))) {