Browse Source

Fix a bug with feed_before_insert hook

$feed->name() was called on a null value.

See https://github.com/FreshRSS/FreshRSS/issues/252
Marien Fressinaud 11 years ago
parent
commit
28c77f2290
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Controllers/feedController.php

+ 2 - 1
app/Controllers/feedController.php

@@ -139,9 +139,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 			$feed->_httpAuth($http_auth);
 			$feed->_httpAuth($http_auth);
 
 
 			// Call the extension hook
 			// Call the extension hook
+			$name = $feed->name();
 			$feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed);
 			$feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed);
 			if (is_null($feed)) {
 			if (is_null($feed)) {
-				Minz_Request::bad(_t('feed_not_added', $feed->name()), $url_redirect);
+				Minz_Request::bad(_t('feed_not_added', $name), $url_redirect);
 			}
 			}
 
 
 			$values = array(
 			$values = array(