Merge pull request #16048 from owncloud/fix-mb-string

Check `mbstring.func_overload` only if the mb module is installed.
This commit is contained in:
Lukas Reschke 2015-05-04 20:19:11 +02:00
commit 044ee7ead5
1 changed files with 13 additions and 7 deletions

View File

@ -671,7 +671,6 @@ class OC_Util {
'PDO::ATTR_DRIVER_NAME' => 'PDO'
),
'ini' => [
'mbstring.func_overload' => 0,
'default_charset' => 'UTF-8',
],
);
@ -685,6 +684,7 @@ class OC_Util {
* approach to check for these values we should re-enable those
* checks.
*/
$iniWrapper = \OC::$server->getIniWrapper();
if (!self::runningOnHhvm()) {
foreach ($dependencies['classes'] as $class => $module) {
if (!class_exists($class)) {
@ -702,7 +702,6 @@ class OC_Util {
}
}
foreach ($dependencies['ini'] as $setting => $expected) {
$iniWrapper = \OC::$server->getIniWrapper();
if (is_bool($expected)) {
if ($iniWrapper->getBool($setting) !== $expected) {
$invalidIniSettings[] = [$setting, $expected];
@ -739,13 +738,20 @@ class OC_Util {
$webServerRestart = true;
}
if (version_compare(phpversion(), '5.4.0', '<')) {
/**
* The mbstring.func_overload check can only be performed if the mbstring
* module is installed as it will return null if the checking setting is
* not available and thus a check on the boolean value fails.
*
* TODO: Should probably be implemented in the above generic dependency
* check somehow in the long-term.
*/
if($iniWrapper->getBool('mbstring.func_overload') !== null &&
$iniWrapper->getBool('mbstring.func_overload') === true) {
$errors[] = array(
'error' => $l->t('PHP %s or higher is required.', '5.4.0'),
'hint' => $l->t('Please ask your server administrator to update PHP to the latest version.'
. ' Your PHP version is no longer supported by ownCloud and the PHP community.')
'error' => $l->t('mbstring.func_overload is set to "%s" instead to the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]),
'hint' => $l->t('To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini')
);
$webServerRestart = true;
}
/**