Browse Source

Merge pull request #66 from php-engineer/master-redirect

Issue with autoPostRedirect while CLI test
Mark 11 years ago
parent
commit
694af799ea
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Controller/Component/CommonComponent.php

+ 6 - 1
Controller/Component/CommonComponent.php

@@ -449,7 +449,12 @@ class CommonComponent extends Component {
 		}
 
 		if (!$conditionalAutoRedirect || empty($this->Controller->autoRedirectActions) || is_array($referer) && !empty($referer['action'])) {
-			$refererController = Inflector::camelize($referer['controller']);
+			// Be sure that controller offset exists, otherwise you
+			// will run into problems, if you use url rewriting.
+			$refererController = null;
+			if (isset($referer['controller'])) {
+				$refererController = Inflector::camelize($referer['controller']);
+			}
 			// fixme
 			if (!isset($this->Controller->autoRedirectActions)) {
 				$this->Controller->autoRedirectActions = array();