From 8a0abb5953300f264d9d7434f130e41a34e3f880 Mon Sep 17 00:00:00 2001 From: Sophia Fuhrmann Date: Mon, 8 Apr 2024 11:57:42 +0200 Subject: [PATCH] Check if identifier is string in StorageDriver --- Classes/Driver/StorageDriver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/Driver/StorageDriver.php b/Classes/Driver/StorageDriver.php index f7b5599..7d3a9e5 100644 --- a/Classes/Driver/StorageDriver.php +++ b/Classes/Driver/StorageDriver.php @@ -282,6 +282,10 @@ public function folderExists($folderIdentifier): bool */ public function isWithin($folderIdentifier, $identifier): bool { + if (!is_string($folderIdentifier) || !is_string($identifier)) { + return false; + } + $trimmedIdentifier = ltrim($identifier, '/'); $searchIdentifier = '/' . $trimmedIdentifier; return str_starts_with($searchIdentifier, $folderIdentifier);