[Pkg-owncloud-commits] [owncloud] 53/122: Check `mbstring.func_overload` only if the mb module is installed.

David Prévot taffit at moszumanska.debian.org
Sat May 9 00:00:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 7c5558327d04d498332f787e91552a3218f9ecd9
Author: Lukas Reschke <lukas at owncloud.com>
Date:   Mon May 4 16:14:12 2015 +0200

    Check `mbstring.func_overload` only if the mb module is installed.
    
    Fixes https://github.com/owncloud/core/issues/14670
---
 lib/private/util.php | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/lib/private/util.php b/lib/private/util.php
index 177934a..f8776c2 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -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];
@@ -740,6 +739,22 @@ class OC_Util {
 		}
 
 		/**
+		 * 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('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')
+			);
+		}
+
+		/**
 		 * PHP 5.6 ships with a PHP setting which throws notices by default for a
 		 * lot of endpoints. Thus we need to ensure that the value is set to -1
 		 *

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list