From f6bf9de6def749b26d44a6f8d8ef85d0561cfaf9 Mon Sep 17 00:00:00 2001
From: Florin Peter <github@florin-peter.de>
Date: Sat, 25 May 2013 14:54:36 +0200
Subject: [PATCH] prevent for returning while false normalize string

---
 lib/util.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/util.php b/lib/util.php
index 224ed32061..1c5a044be8 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -833,7 +833,12 @@ class OC_Util {
 	 */
 	public static function normalizeUnicode($value) {
 		if(class_exists('Patchwork\PHP\Shim\Normalizer')) {
-			$value = \Patchwork\PHP\Shim\Normalizer::normalize($value);
+			$normalizedValue = \Patchwork\PHP\Shim\Normalizer::normalize($value);
+			if($normalizedValue === false) {
+				\OC_Log::write( 'core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN);
+			} else {
+				$value = $normalizedValue;
+			}
 		}
 
 		return $value;
-- 
GitLab