mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fix ControllerTestCase redirect
This commit is contained in:
parent
76f7754014
commit
e753fbadca
1 changed files with 4 additions and 1 deletions
|
@ -751,7 +751,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
*
|
||||
* @param string|array $url A string or array-based URL pointing to another location within the app,
|
||||
* or an absolute URL
|
||||
* @param int $status Optional HTTP status code (eg: 404)
|
||||
* @param int $status HTTP status code (eg: 301)
|
||||
* @param bool $exit If true, exit() will be called after the redirect
|
||||
* @return void
|
||||
* @triggers Controller.beforeRedirect $this, array($url, $status, $exit)
|
||||
|
@ -785,6 +785,9 @@ class Controller extends Object implements CakeEventListener {
|
|||
}
|
||||
}
|
||||
|
||||
if ($status === null) {
|
||||
$status = 302;
|
||||
}
|
||||
if ($status) {
|
||||
$this->response->statusCode($status);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue