Explorar el Código

Fix CSS selector encoding (#6426)

fix https://github.com/FreshRSS/FreshRSS/issues/6229
fix https://github.com/FreshRSS/FreshRSS/issues/6266#issuecomment-2090432818
Alexandre Alapetite hace 1 año
padre
commit
44625eed25
Se han modificado 2 ficheros con 3 adiciones y 1 borrados
  1. 1 0
      app/Controllers/feedController.php
  2. 2 1
      app/Models/Entry.php

+ 1 - 0
app/Controllers/feedController.php

@@ -1148,6 +1148,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
 			return;
 		}
 		$feed->_pathEntries($content_selector);
+		$feed->_attribute('path_entries_filter', Minz_Request::paramString('selector_filter', true));
 
 		//Fetch & select content.
 		try {

+ 2 - 1
app/Models/Entry.php

@@ -748,7 +748,8 @@ HTML;
 			}
 
 			$content = '';
-			$nodes = $xpath->query((new Gt\CssXPath\Translator($feed->pathEntries()))->asXPath());
+			$cssSelector = htmlspecialchars_decode($feed->pathEntries(), ENT_QUOTES);
+			$nodes = $xpath->query((new Gt\CssXPath\Translator($cssSelector))->asXPath());
 			if ($nodes != false) {
 				$path_entries_filter = $feed->attributeString('path_entries_filter');
 				foreach ($nodes as $node) {