Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed HTTP status codes for non-redirects which were breaking AuthCom…

…ponent.
  • Loading branch information...
commit 7bb56e7fc38a68993dc4158a54a255111d017a92 1 parent ed1a64c
@Phally Phally authored
View
17 lib/Cake/Controller/Controller.php
@@ -531,7 +531,7 @@ protected function _getScaffold(CakeRequest $request) {
}
/**
- * Merge components, helpers, and uses vars from
+ * Merge components, helpers, and uses vars from
* Controller::$_mergeParent and PluginAppController.
*
* @return void
@@ -770,18 +770,17 @@ public function redirect($url, $status = null, $exit = true) {
session_write_close();
}
- if (!empty($status) && is_string($status)) {
- $codes = array_flip($this->response->httpCodes());
- if (isset($codes[$status])) {
- $status = $codes[$status];
- }
- }
-
if ($url !== null) {
$this->response->header('Location', Router::url($url, true));
}
- if (!empty($status) && ($status >= 300 && $status < 400)) {
+ if (!empty($status)) {
+ if (is_string($status)) {
+ $codes = array_flip($this->response->httpCodes());
+ if (isset($codes[$status])) {
+ $status = $codes[$status];
+ }
+ }
$this->response->statusCode($status);
}
View
5 lib/Cake/Test/Case/Controller/ControllerTest.php
@@ -387,7 +387,7 @@ class AnotherTestController extends ControllerTestAppController {
/**
* merge parent
- *
+ *
* @var string
*/
protected $_mergeParent = 'ControllerTestAppController';
@@ -729,7 +729,8 @@ public static function statusCodeProvider() {
array(303, "See Other"),
array(304, "Not Modified"),
array(305, "Use Proxy"),
- array(307, "Temporary Redirect")
+ array(307, "Temporary Redirect"),
+ array(403, "Forbidden"),
);
}
Please sign in to comment.
Something went wrong with that request. Please try again.