diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-09-15 14:13:30 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-09-15 14:13:30 +0200 |
commit | 07b14bcd4fb5b83701150d6e6ea5bf27ecc0e105 (patch) | |
tree | 1a6c21ccc2d818461b2dea52089b2706c8fe9e47 | |
parent | 31898aa63548be8492b826b9bac6dc0f8bca8dee (diff) | |
parent | 59209e0f2b3376c7a03df393fc731ca99ced1213 (diff) | |
download | nextcloud-server-07b14bcd4fb5b83701150d6e6ea5bf27ecc0e105.tar.gz nextcloud-server-07b14bcd4fb5b83701150d6e6ea5bf27ecc0e105.zip |
Merge pull request #10960 from owncloud/use-intl-module-master
use intl's native normalizer_normalize() in case the module is available
-rw-r--r-- | lib/base.php | 3 | ||||
-rwxr-xr-x | lib/private/util.php | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/base.php b/lib/base.php index c113ed3b506..e21d0124b32 100644 --- a/lib/base.php +++ b/lib/base.php @@ -496,6 +496,9 @@ class OC { require_once $vendorAutoLoad; } + // initialize intl fallback is necessary + \Patchwork\Utf8\Bootup::initIntl(); + if (!defined('PHPUNIT_RUN')) { OC\Log\ErrorHandler::setLogger(OC_Log::$object); if (defined('DEBUG') and DEBUG) { diff --git a/lib/private/util.php b/lib/private/util.php index a130d997ca3..79f3eb7b48c 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1402,13 +1402,11 @@ class OC_Util { * @return bool|string */ public static function normalizeUnicode($value) { - if (class_exists('Patchwork\PHP\Shim\Normalizer')) { - $normalizedValue = \Patchwork\PHP\Shim\Normalizer::normalize($value); - if ($normalizedValue === false) { - \OC_Log::write('core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN); - } else { - $value = $normalizedValue; - } + $normalizedValue = normalizer_normalize($value); + if ($normalizedValue === null || $normalizedValue === false) { + \OC_Log::write('core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN); + } else { + $value = $normalizedValue; } return $value; |