From 4a5490dc587a5e607e9baba653b3eb155304c209 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 11 Nov 2016 14:08:40 +0300 Subject: [PATCH] feedparser: fix normalize_encoding() not working properly for some encodings --- classes/feedparser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);