mirror of
https://github.com/wallabag/wallabag.git
synced 2024-10-31 22:28:54 +00:00
Factorize
This commit is contained in:
parent
7672a10776
commit
af8b3b649e
1 changed files with 3 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue