Przeglądaj źródła

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 lat temu
rodzic
commit
28c77f2290
1 zmienionych plików z 2 dodań i 1 usunięć
  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);
 
 			// Call the extension hook
+			$name = $feed->name();
 			$feed = Minz_ExtensionManager::callHook('feed_before_insert', $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(