Skip to content

Commit

Permalink
Fix Message: strtoupper(): Passing null in Security.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenanhung committed Sep 21, 2024
1 parent 84e2da6 commit 642fa77
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system/core/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,14 @@ public function __construct()
*/
public function csrf_verify()
{
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == ''){
$requestMethod = strtoupper((string) $_SERVER['REQUEST_METHOD']);
} else {
$requestMethod = '';
}
// If it's not a POST request we will set the CSRF cookie
if (strtoupper($_SERVER['REQUEST_METHOD']) !== 'POST') {
if ($requestMethod !== 'POST') {
return $this->csrf_set_cookie();
}
Expand Down

0 comments on commit 642fa77

Please sign in to comment.