mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 15:25:59 +00:00
try to force-convert feed data to utf8
This commit is contained in:
@@ -17,7 +17,22 @@ class FeedParser {
|
||||
libxml_clear_errors();
|
||||
$this->doc = new DOMDocument();
|
||||
$this->doc->loadXML($data);
|
||||
$this->error = $this->format_error(libxml_get_last_error());
|
||||
|
||||
$error = libxml_get_last_error();
|
||||
|
||||
if ($error && $error->code == 9) {
|
||||
libxml_clear_errors();
|
||||
|
||||
// we might want to try guessing input encoding here too
|
||||
$data = iconv("UTF-8", "UTF-8//IGNORE", $data);
|
||||
|
||||
$this->doc = new DOMDocument();
|
||||
$this->doc->loadXML($data);
|
||||
|
||||
$error = libxml_get_last_error();
|
||||
}
|
||||
|
||||
$this->error = $this->format_error($error);
|
||||
libxml_clear_errors();
|
||||
|
||||
$this->items = array();
|
||||
|
||||
Reference in New Issue
Block a user