From: Andrew Dolgov Date: Fri, 11 Nov 2016 11:08:40 +0000 (+0300) Subject: feedparser: fix normalize_encoding() not working properly for some encodings X-Git-Tag: 17.1~36 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4a5490dc587a5e607e9baba653b3eb155304c209;p=tt-rss.git feedparser: fix normalize_encoding() not working properly for some encodings --- diff --git a/classes/feedparser.php b/classes/feedparser.php index 3296381e..08f8c1de 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -18,7 +18,7 @@ class FeedParser { $encoding = strtolower($matches[2]); - if (in_array($encoding, mb_list_encodings())) + if (in_array($encoding, array_map('strtolower', mb_list_encodings()))) { $data = mb_convert_encoding($data, 'UTF-8', $encoding); $data = preg_replace('/^<\?xml[\t\n\r ].*?\?>/s', $matches[1] . "UTF-8" . $matches[3] , $data);