浏览代码

Fix HTML base for get full content (#4260)

#fix https://github.com/FreshRSS/FreshRSS/issues/4252
Alexandre Alapetite 4 年之前
父节点
当前提交
dc849c3d87
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 4 0
      app/Models/Entry.php
  2. 1 1
      lib/lib_phpQuery.php

+ 4 - 0
app/Models/Entry.php

@@ -508,6 +508,10 @@ class FreshRSS_Entry extends Minz_Model {
 			 * @var phpQueryObject @content
 			 */
 			$content = $doc->find($path);
+			$bases = $doc->document->getElementsByTagName('base');
+			if (!empty($bases[0]) && $bases[0]->getAttribute('href') != '') {
+				$url = $bases[0]->getAttribute('href');
+			}
 			$html = trim(sanitizeHTML($content->__toString(), $url));
 			phpQuery::unloadDocuments();
 			return $html;

+ 1 - 1
lib/lib_phpQuery.php

@@ -2917,7 +2917,7 @@ class phpQueryObject
 	 * jQuey difference
 	 *
 	 * @param $markup
-	 * @return unknown_type
+	 * @return string
 	 */
 	public function markupOuter($callback1 = null, $callback2 = null, $callback3 = null) {
 		$args = func_get_args();