Skip to content

Commit

Permalink
use null coalescing operator for index exists check
Browse files Browse the repository at this point in the history
Co-authored-by: Joas Schilling <[email protected]>
  • Loading branch information
korelstar and nickvergessen authored May 1, 2021
1 parent edc3925 commit 1533634
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public function beforeController($controller, $methodName) {
// ensure that @CORS annotated API routes are not used in conjunction
// with session authentication since this enables CSRF attack vectors
if ($this->reflector->hasAnnotation('CORS') && !$this->reflector->hasAnnotation('PublicPage')) {
$user = array_key_exists('PHP_AUTH_USER', $this->request->server) ? $this->request->server['PHP_AUTH_USER'] : null;
$pass = array_key_exists('PHP_AUTH_PW', $this->request->server) ? $this->request->server['PHP_AUTH_PW'] : null;
$user = $this->request->server['PHP_AUTH_USER'] ?? null;
$pass = $this->request->server['PHP_AUTH_PW'] ?? null;

$this->session->logout();
try {
Expand Down

0 comments on commit 1533634

Please sign in to comment.