mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Use ternary operator
This commit is contained in:
parent
b7481096c8
commit
26731b93bf
2 changed files with 2 additions and 4 deletions
|
@ -741,10 +741,7 @@ class AuthComponent extends Component {
|
||||||
$this->Session->delete('Auth.redirect');
|
$this->Session->delete('Auth.redirect');
|
||||||
|
|
||||||
if (Router::normalize($redir) === Router::normalize($this->loginAction)) {
|
if (Router::normalize($redir) === Router::normalize($this->loginAction)) {
|
||||||
$redir = $this->loginRedirect;
|
$redir = $this->loginRedirect ?: '/';
|
||||||
if (!$redir) {
|
|
||||||
$redir = '/';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} elseif ($this->loginRedirect) {
|
} elseif ($this->loginRedirect) {
|
||||||
$redir = $this->loginRedirect;
|
$redir = $this->loginRedirect;
|
||||||
|
|
|
@ -1659,6 +1659,7 @@ class AuthComponentTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testRedirectUrlWithoutLoginRedirect() {
|
public function testRedirectUrlWithoutLoginRedirect() {
|
||||||
|
$this->Auth->loginRedirect = null;
|
||||||
$this->Auth->Session->write('Auth.redirect', '/users/login');
|
$this->Auth->Session->write('Auth.redirect', '/users/login');
|
||||||
$this->Auth->request->addParams(Router::parse('/users/login'));
|
$this->Auth->request->addParams(Router::parse('/users/login'));
|
||||||
$result = $this->Auth->redirectUrl();
|
$result = $this->Auth->redirectUrl();
|
||||||
|
|
Loading…
Add table
Reference in a new issue