Skip to content
Snippets Groups Projects
Commit c259733b authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #13223 from owncloud/optimize-normalize-unicode

Verify whether value is already normalized
parents 8057bc66 e80ece9a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment