mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Apply utf8_encode only on unrecognized encoded string
This commit is contained in:
parent
ccf59ac4ff
commit
7672a10776
1 changed files with 12 additions and 5 deletions
|
@ -239,7 +239,7 @@ final class Tools
|
|||
*/
|
||||
public static function utf8ize($data)
|
||||
{
|
||||
if (is_array($data))
|
||||
if (is_array($data))
|
||||
{
|
||||
foreach ($data as $k => $v)
|
||||
{
|
||||
|
@ -248,7 +248,14 @@ final class Tools
|
|||
}
|
||||
else if (is_string ($data))
|
||||
{
|
||||
return utf8_encode($data);
|
||||
if ('' == mb_detect_encoding($data))
|
||||
{
|
||||
return utf8_encode($data);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue