diff options
| author | 2024-11-28 17:11:04 +0100 | |
|---|---|---|
| committer | 2024-11-28 17:11:04 +0100 | |
| commit | 15745d42b779ad14efde2932ab116f45eee39246 (patch) | |
| tree | 2528a36184d8152d4f2d90dc73df680f84bbe1d1 /p/ext.php | |
| parent | 604b186638276203c8495a3ee86da0cc240ab4d0 (diff) | |
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 <l.sanchez-prestataire@alptis.fr>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'p/ext.php')
| -rw-r--r-- | p/ext.php | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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.'); } |
