diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-10 16:33:54 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-10 16:33:54 +0100 |
commit | c259733b881138c273b4af18d788f3df53497871 (patch) | |
tree | 6374aa4d70a978f8364c8eaeefbddb7ad431a0cf /lib | |
parent | 8057bc6646765a5e70f1dd79a5576fca850c4582 (diff) | |
parent | e80ece9a2b39d18eea356196a08211c6b36a4048 (diff) | |
download | nextcloud-server-c259733b881138c273b4af18d788f3df53497871.tar.gz nextcloud-server-c259733b881138c273b4af18d788f3df53497871.zip |
Merge pull request #13223 from owncloud/optimize-normalize-unicode
Verify whether value is already normalized
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/util.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index 3178639b02e..ec3640503e4 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1274,14 +1274,17 @@ class OC_Util { * @return bool|string */ public static function normalizeUnicode($value) { - $normalizedValue = normalizer_normalize($value); + if(Normalizer::isNormalized($value)) { + return $value; + } + + $normalizedValue = Normalizer::normalize($value); if ($normalizedValue === null || $normalizedValue === false) { - \OC_Log::write('core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN); - } else { - $value = $normalizedValue; + \OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']); + return $value; } - return $value; + return $normalizedValue; } /** |