From 15745d42b779ad14efde2932ab116f45eee39246 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:11:04 +0100 Subject: Upgrade code to php 8.1 (#6748) * revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez Co-authored-by: Alexandre Alapetite --- p/ext.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'p/ext.php') diff --git a/p/ext.php b/p/ext.php index 5d95107da..0a8c46546 100644 --- a/p/ext.php +++ b/p/ext.php @@ -48,7 +48,7 @@ function is_valid_path_extension(string $path, string $extensionPath, bool $isSt $real_ext_path = str_replace('\\', '/', $real_ext_path); $path = str_replace('\\', '/', $path); - $in_ext_path = (substr($path, 0, strlen($real_ext_path)) === $real_ext_path); + $in_ext_path = (str_starts_with($path, $real_ext_path)); if (!$in_ext_path) { return false; } @@ -93,8 +93,7 @@ function sendNotFoundResponse(): never { die(); } -if (!isset($_GET['f']) || !is_string($_GET['f']) || - !isset($_GET['t']) || !is_string($_GET['t'])) { +if (!isset($_GET['f'], $_GET['t']) || !is_string($_GET['f']) || !is_string($_GET['t'])) { sendBadRequestResponse('Query string is incomplete.'); } -- cgit v1.2.3