]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Factorize 1866/head
authorYmage <heltem+github@o2php.com>
Thu, 7 Apr 2016 20:49:15 +0000 (22:49 +0200)
committerYmage <heltem+github@o2php.com>
Thu, 7 Apr 2016 20:49:15 +0000 (22:49 +0200)
inc/poche/Tools.class.php

index 2ee86c74e7ccb5823bfd4663454ba3ca90f8eab0..263034f07d3363e5df1b23781dae68a46d5736b3 100755 (executable)
@@ -239,23 +239,16 @@ final class Tools
      */
     public static function utf8ize($data)
     {
-       if (is_array($data))
+        if (is_array($data))
         {
             foreach ($data as $k => $v)
             {
                 $data[$k] = self::utf8ize($v);
             }
         }
-        else if (is_string ($data))
+        else if (is_string ($data) && '' == mb_detect_encoding($data))
         {
-            if ('' == mb_detect_encoding($data))
-            {
-                return utf8_encode($data);
-            }
-            else
-            {
-                return $data;
-            }
+            return utf8_encode($data);
         }
         return $data;
     }