Browse Source

redirects should return early

euromark 12 years ago
parent
commit
ec66c14034
2 changed files with 5 additions and 5 deletions
  1. 3 3
      Controller/QloginController.php
  2. 2 2
      Controller/TinyUrlsController.php

+ 3 - 3
Controller/QloginController.php

@@ -42,7 +42,7 @@ class QloginController extends ToolsAppController {
 
 		if (empty($entry)) {
 			$this->Common->flashMessage(__('Invalid Key'), 'error');
-			$this->Common->autoRedirect($default);
+			return $this->Common->autoRedirect($default);
 		}
 		//die(returns($entry));
 		$uid = $entry['CodeKey']['user_id'];
@@ -60,7 +60,7 @@ class QloginController extends ToolsAppController {
 				trigger_error($this->Auth->loginError . ' - uid ' . $uid);
 			}
 		}
-		$this->redirect($url);
+		return $this->redirect($url);
 	}
 
 	/**
@@ -110,7 +110,7 @@ class QloginController extends ToolsAppController {
 		$this->CodeKey = ClassRegistry::init('Tools.CodeKey');
 		$this->CodeKey->deleteAll(array('type'=>'qlogin'));
 		$this->Common->flashMessage(__('Success'), 'success');
-		$this->Common->autoRedirect(array('action'=>'index'));
+		return $this->Common->autoRedirect(array('action'=>'index'));
 	}
 
 }

+ 2 - 2
Controller/TinyUrlsController.php

@@ -53,7 +53,7 @@ class TinyUrlsController extends ToolsAppController {
 			$this->Common->flashMessage($message, $type);
 		}
 		$this->TinyUrl->up($entry['TinyUrl']['id'], array('field'=>'used', 'modify'=>true, 'timestampField'=>'last_used'));
-		$this->redirect($url, 301);
+		return $this->redirect($url, 301);
 	}
 
 
@@ -86,7 +86,7 @@ class TinyUrlsController extends ToolsAppController {
 		}
 		$this->TinyUrl->truncate();
 		$this->Common->flashMessage(__('Done'), 'success');
-		$this->Common->autoRedirect(array('action'=>'index'));
+		return $this->Common->autoRedirect(array('action'=>'index'));
 	}
 
 }