From 08c6a1bdc16d7cc9717788172251c6e5eae3e443 Mon Sep 17 00:00:00 2001 From: Clemens Neubauer Date: Sat, 7 Dec 2019 12:59:53 +0100 Subject: Extend hooks (#2704) It adds two new hooks to have more options for influencing with extensions. --- app/Controllers/feedController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/Controllers/feedController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 3eb2316b8..d395f76d0 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -47,6 +47,12 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $url = trim($url); + /** @var $url */ + $url = Minz_ExtensionManager::callHook('check_url_before_add', $url); + if (null === $url) { + throw new FreshRSS_FeedNotAdded_Exception($url, $title); + } + $cat = null; if ($new_cat_name != '') { $new_cat_id = $catDAO->addCategory(array('name' => $new_cat_name)); @@ -274,6 +280,12 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $updated_feeds = 0; $nb_new_articles = 0; foreach ($feeds as $feed) { + /** @var FreshRSS_Feed $feed */ + $feed = Minz_ExtensionManager::callHook('feed_before_actualize', $feed); + if (null === $feed) { + continue; + } + $url = $feed->url(); //For detection of HTTP 301 $pubSubHubbubEnabled = $pubsubhubbubEnabledGeneral && $feed->pubSubHubbubEnabled(); -- cgit v1.2.3