mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +01:00
Fatal during setup for "mbstring.func_overload"
Summary: Fixes T5545. We assume `strlen()` returns the number of bytes in a string, which is the normal behavior (and the documented behavior). There's a config option, `mbstring.func_overload`, which silently calls mb_strlen() instead. This may return some other result, might fail, etc., and there's no way to get the byte length of a string if this option is set. If this option is set, fatal immediately. Nothing good can ever come of it. Test Plan: {F173990} Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T5545 Differential Revision: https://secure.phabricator.com/D9811
This commit is contained in:
parent
7baa0941b9
commit
04d5402e2f
1 changed files with 17 additions and 0 deletions
|
@ -75,6 +75,23 @@ final class PhabricatorSetupCheckPHPConfig extends PhabricatorSetupCheck {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$overload_option = 'mbstring.func_overload';
|
||||||
|
$func_overload = ini_get($overload_option);
|
||||||
|
if ($func_overload) {
|
||||||
|
$message = pht(
|
||||||
|
"You have '%s' enabled in your PHP configuration.\n\n".
|
||||||
|
"This option is not compatible with Phabricator. Disable ".
|
||||||
|
"'%s' in your PHP configuration to continue.",
|
||||||
|
$overload_option,
|
||||||
|
$overload_option);
|
||||||
|
|
||||||
|
$this->newIssue('php'.$overload_option)
|
||||||
|
->setIsFatal(true)
|
||||||
|
->setName(pht('Disable PHP %s', $overload_option))
|
||||||
|
->setMessage($message)
|
||||||
|
->addPHPConfig($overload_option);
|
||||||
|
}
|
||||||
|
|
||||||
$open_basedir = ini_get('open_basedir');
|
$open_basedir = ini_get('open_basedir');
|
||||||
if ($open_basedir) {
|
if ($open_basedir) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue