use intl's native normalizer_normalize() in case the module is available
This commit is contained in:
parent
bfebbe47de
commit
59209e0f2b
|
@ -495,6 +495,9 @@ class OC {
|
||||||
require_once $vendorAutoLoad;
|
require_once $vendorAutoLoad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initialize intl fallback is necessary
|
||||||
|
\Patchwork\Utf8\Bootup::initIntl();
|
||||||
|
|
||||||
if (!defined('PHPUNIT_RUN')) {
|
if (!defined('PHPUNIT_RUN')) {
|
||||||
OC\Log\ErrorHandler::setLogger(OC_Log::$object);
|
OC\Log\ErrorHandler::setLogger(OC_Log::$object);
|
||||||
if (defined('DEBUG') and DEBUG) {
|
if (defined('DEBUG') and DEBUG) {
|
||||||
|
|
|
@ -1402,14 +1402,12 @@ class OC_Util {
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
public static function normalizeUnicode($value) {
|
public static function normalizeUnicode($value) {
|
||||||
if (class_exists('Patchwork\PHP\Shim\Normalizer')) {
|
$normalizedValue = normalizer_normalize($value);
|
||||||
$normalizedValue = \Patchwork\PHP\Shim\Normalizer::normalize($value);
|
if ($normalizedValue === null || $normalizedValue === false) {
|
||||||
if ($normalizedValue === false) {
|
|
||||||
\OC_Log::write('core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN);
|
\OC_Log::write('core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN);
|
||||||
} else {
|
} else {
|
||||||
$value = $normalizedValue;
|
$value = $normalizedValue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue