A free, self-hostable news aggregator…
Specific HTML load for lib_phpQuery.php (#4243)
Alexandre Alapetite467ca9d0deea
diff --git a/app/Models/Entry.php b/app/Models/Entry.phpindex ab88d777a..243d557ac 100644--- a/app/Models/Entry.php+++ b/app/Models/Entry.php@@ -484,7 +484,7 @@ class FreshRSS_Entry extends Minz_Model {/*** @var phpQueryObject @doc*/- $doc = phpQuery::newDocument($html);+ $doc = phpQuery::newDocumentHTML($html);if ($maxRedirs > 0) {//Follow any HTML redirectiondiff --git a/lib/lib_phpQuery.php b/lib/lib_phpQuery.phpindex 1fabfcb6d..411aa120c 100644--- a/lib/lib_phpQuery.php+++ b/lib/lib_phpQuery.php@@ -436,8 +436,7 @@ class DOMDocumentWrapper {}protected function isXML($markup) {// return strpos($markup, '<?xml') !== false && stripos($markup, 'xhtml') === false;- $head = substr($markup, 0, 100);- return strpos($head, '<'.'?xml') !== false && stripos($head, '<html ') === false;+ return strpos(substr($markup, 0, 100), '<'.'?xml') !== false;}protected function contentTypeToArray($contentType) {$matches = explode(';', trim(strtolower($contentType)));