Add a feed_before_insert hook

See https://github.com/FreshRSS/FreshRSS/issues/252
This commit is contained in:
Marien Fressinaud
2014-12-08 13:05:56 +01:00
parent a79107fb04
commit 188b517daa
3 changed files with 27 additions and 10 deletions

View File

@@ -138,6 +138,12 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$feed->_category($cat);
$feed->_httpAuth($http_auth);
// Call the extension hook
$feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed);
if (is_null($feed)) {
Minz_Request::bad(_t('feed_not_added', $feed->name()), $url_redirect);
}
$values = array(
'url' => $feed->url(),
'category' => $feed->category(),