Przeglądaj źródła

Fix bug token

The token should appear in RSS feed url when anonymous are not allowed
Marien Fressinaud 12 lat temu
rodzic
commit
fb7bc50673
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      app/Controllers/indexController.php

+ 5 - 5
app/Controllers/indexController.php

@@ -5,18 +5,15 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 
 	public function indexAction () {
 		$output = Minz_Request::param ('output');
-		$token = '';
+		$token = $this->view->conf->token;
 
 		// check if user is logged in
-		if (!$this->view->loginOk && !Minz_Configuration::allowAnonymous())
-		{
-			$token = $this->view->conf->token;
+		if (!$this->view->loginOk && !Minz_Configuration::allowAnonymous()) {
 			$token_param = Minz_Request::param ('token', '');
 			$token_is_ok = ($token != '' && $token === $token_param);
 			if (!($output === 'rss' && $token_is_ok)) {
 				return;
 			}
-			$params['token'] = $token;
 		}
 
 		// construction of RSS url of this feed
@@ -25,6 +22,9 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 		if (isset ($params['search'])) {
 			$params['search'] = urlencode ($params['search']);
 		}
+		if (!Minz_Configuration::allowAnonymous()) {
+			$params['token'] = $token;
+		}
 		$this->view->rss_url = array (
 			'c' => 'index',
 			'a' => 'index',