From 9423d72f6c82f05a5c7512370ac413776747f540 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 May 2019 10:13:22 +0300 Subject: parser: force libxml error messages to valid utf8 --- classes/feedparser.php | 4 +++- classes/rssutils.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/feedparser.php b/classes/feedparser.php index 400cc7095..9677164d3 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -183,10 +183,12 @@ class FeedParser { } } + // libxml may have invalid unicode data in error messages function error() { - return $this->error; + return UConverter::transcode($this->error, 'UTF-8', 'UTF-8'); } + // WARNING: may return invalid unicode data function errors() { return $this->libxml_errors; } diff --git a/classes/rssutils.php b/classes/rssutils.php index 4aa9a0379..68e0255ed 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1170,10 +1170,12 @@ class RSSUtils { $sth->execute([$error_msg, $feed]); unset($rss); + + Debug::log("update failed.", Debug::$LOG_VERBOSE); return false; } - Debug::log("done", Debug::$LOG_VERBOSE); + Debug::log("update done.", Debug::$LOG_VERBOSE); return true; } -- cgit v1.2.3