diff options
| author | 2020-02-13 19:22:35 +0200 | |
|---|---|---|
| committer | 2020-02-13 18:22:35 +0100 | |
| commit | d30ac40772ec1b4706922afd8acab8448af39a9e (patch) | |
| tree | 6b7cec8455a542875959a09f7bdcc7a2af285fa1 /app/Models/Entry.php | |
| parent | 4ddd1821bb0fc1186937551d59100294b8833727 (diff) | |
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 <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Marien Fressinaud <dev@marienfressinaud.fr>
Diffstat (limited to 'app/Models/Entry.php')
| -rw-r--r-- | app/Models/Entry.php | 8 |
1 files changed, 4 insertions, 4 deletions
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() |
