From d30ac40772ec1b4706922afd8acab8448af39a9e Mon Sep 17 00:00:00 2001 From: Julien-Pierre Avérous Date: Thu, 13 Feb 2020 19:22:35 +0200 Subject: Enhance content path feature (#2778) - Add a maintenance section to be able to clear cache and force reload a feed. - Add an icon next to path field to show a pop-up with the result of the content path. Co-authored-by: Frans de Jonge Co-authored-by: Alexandre Alapetite Co-authored-by: Marien Fressinaud --- app/Models/Entry.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index ab55c140d..813e63bb0 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -330,7 +330,7 @@ class FreshRSS_Entry extends Minz_Model { } } - private static function get_content_by_parsing($url, $path, $attributes = array()) { + public static function getContentByParsing($url, $path, $attributes = array()) { require_once(LIB_PATH . '/lib_phpQuery.php'); $system_conf = Minz_Configuration::get('system'); $limits = $system_conf->limits; @@ -387,7 +387,7 @@ class FreshRSS_Entry extends Minz_Model { } } - public function loadCompleteContent() { + public function loadCompleteContent($force = false) { // Gestion du contenu // On cherche à récupérer les articles en entier... même si le flux ne le propose pas $feed = $this->feed(true); @@ -395,13 +395,13 @@ class FreshRSS_Entry extends Minz_Model { $entryDAO = FreshRSS_Factory::createEntryDao(); $entry = $entryDAO->searchByGuid($this->feedId, $this->guid); - if ($entry) { + if ($entry && !$force) { // l'article existe déjà en BDD, en se contente de recharger ce contenu $this->content = $entry->content(); } else { try { // l'article n'est pas en BDD, on va le chercher sur le site - $fullContent = self::get_content_by_parsing( + $fullContent = self::getContentByParsing( htmlspecialchars_decode($this->link(), ENT_QUOTES), $feed->pathEntries(), $feed->attributes() -- cgit v1.2.3