aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYmage <heltem+github@o2php.com>2016-04-07 22:49:15 +0200
committerYmage <heltem+github@o2php.com>2016-04-07 22:49:15 +0200
commitaf8b3b649e9956fe15c98298faf6755c29edcf77 (patch)
tree3fd2b8f4553a3ba3e7820b864a9a722fc3064f1c
parent7672a10776136842906e4f34e3ced0d7286f1c4a (diff)
downloadwallabag-af8b3b649e9956fe15c98298faf6755c29edcf77.tar.gz
wallabag-af8b3b649e9956fe15c98298faf6755c29edcf77.tar.zst
wallabag-af8b3b649e9956fe15c98298faf6755c29edcf77.zip
Factorize
-rwxr-xr-xinc/poche/Tools.class.php13
1 files changed, 3 insertions, 10 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php
index 2ee86c74..263034f0 100755
--- a/inc/poche/Tools.class.php
+++ b/inc/poche/Tools.class.php
@@ -239,23 +239,16 @@ final class Tools
239 */ 239 */
240 public static function utf8ize($data) 240 public static function utf8ize($data)
241 { 241 {
242 if (is_array($data)) 242 if (is_array($data))
243 { 243 {
244 foreach ($data as $k => $v) 244 foreach ($data as $k => $v)
245 { 245 {
246 $data[$k] = self::utf8ize($v); 246 $data[$k] = self::utf8ize($v);
247 } 247 }
248 } 248 }
249 else if (is_string ($data)) 249 else if (is_string ($data) && '' == mb_detect_encoding($data))
250 { 250 {
251 if ('' == mb_detect_encoding($data)) 251 return utf8_encode($data);
252 {
253 return utf8_encode($data);
254 }
255 else
256 {
257 return $data;
258 }
259 } 252 }
260 return $data; 253 return $data;
261 } 254 }