Skip to content

Commit

Permalink
Merge pull request #14 from nextmotion/sd/check-null-identifier
Browse files Browse the repository at this point in the history
Check if identifier is string in StorageDriver
  • Loading branch information
ptheg authored Apr 8, 2024
2 parents fdf3360 + 8a0abb5 commit fcc8616
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/Driver/StorageDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fcc8616

Please sign in to comment.