mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +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');
|
||||
|
||||
if (Router::normalize($redir) === Router::normalize($this->loginAction)) {
|
||||
$redir = $this->loginRedirect;
|
||||
if (!$redir) {
|
||||
$redir = '/';
|
||||
}
|
||||
$redir = $this->loginRedirect ?: '/';
|
||||
}
|
||||
} elseif ($this->loginRedirect) {
|
||||
$redir = $this->loginRedirect;
|
||||
|
|
|
@ -1659,6 +1659,7 @@ class AuthComponentTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testRedirectUrlWithoutLoginRedirect() {
|
||||
$this->Auth->loginRedirect = null;
|
||||
$this->Auth->Session->write('Auth.redirect', '/users/login');
|
||||
$this->Auth->request->addParams(Router::parse('/users/login'));
|
||||
$result = $this->Auth->redirectUrl();
|
||||
|
|
Loading…
Add table
Reference in a new issue