Skip to content

Commit

Permalink
Avoid passing null to strcasecmp(), for PHP 8.1
Browse files Browse the repository at this point in the history
Bug: T307282
Change-Id: I523928b3f5e0e02e23c45e7023d9d2701d986e5c
  • Loading branch information
samwilson committed Jun 11, 2022
1 parent 2efa42f commit 2a91787
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/session/CookieSessionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ protected function postInitSetup() {
?: $this->getConfig()->get( MainConfigNames::CookiePrefix ) . '_session',
];

$this->useCrossSiteCookies =
strcasecmp( $this->getConfig()->get( MainConfigNames::CookieSameSite ), 'none' ) === 0;
$sameSite = $this->getConfig()->get( MainConfigNames::CookieSameSite );
$this->useCrossSiteCookies = $sameSite !== null && strcasecmp( $sameSite, 'none' ) === 0;

// @codeCoverageIgnoreStart
$this->cookieOptions += [
Expand All @@ -110,7 +110,7 @@ protected function postInitSetup() {
'secure' => $this->getConfig()->get( MainConfigNames::CookieSecure )
|| $this->getConfig()->get( MainConfigNames::ForceHTTPS ),
'httpOnly' => $this->getConfig()->get( MainConfigNames::CookieHttpOnly ),
'sameSite' => $this->getConfig()->get( MainConfigNames::CookieSameSite ),
'sameSite' => $sameSite,
];
}

Expand Down

0 comments on commit 2a91787

Please sign in to comment.