Skip to content

Commit 8631db6

Browse files
committed
Fix Một số lỗi khi chạy trên php8.2 #63
1 parent 642fa77 commit 8631db6

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

system/core/Input.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ public function is_cli_request()
907907
public function method($upper = FALSE)
908908
{
909909
return ($upper)
910-
? strtoupper($this->server('REQUEST_METHOD'))
911-
: strtolower($this->server('REQUEST_METHOD'));
910+
? strtoupper((string) $this->server('REQUEST_METHOD'))
911+
: strtolower((string) $this->server('REQUEST_METHOD'));
912912
}
913913

914914
// ------------------------------------------------------------------------

system/core/Security.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,8 @@ public function __construct()
220220
*/
221221
public function csrf_verify()
222222
{
223-
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == ''){
224-
$requestMethod = strtoupper((string) $_SERVER['REQUEST_METHOD']);
225-
} else {
226-
$requestMethod = '';
227-
}
228-
229223
// If it's not a POST request we will set the CSRF cookie
230-
if ($requestMethod !== 'POST') {
224+
if (strtoupper((string) $_SERVER['REQUEST_METHOD']) !== 'POST') {
231225
return $this->csrf_set_cookie();
232226
}
233227

0 commit comments

Comments
 (0)