refactor: Use str_starts_with

Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2026-01-16 10:58:16 +01:00 committed by GitHub
parent 27339601f6
commit eadcd1cc84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,7 +123,7 @@ class Manager implements IMountManager {
$result = [];
$pathLen = strlen($path);
foreach ($this->mounts as $mountPoint => $mount) {
if (strlen($mountPoint) > $pathLen && strncmp($mountPoint, $path, $pathLen) === 0) {
if (strlen($mountPoint) > $pathLen && str_starts_with($mountPoint, $path)) {
$result[] = $mount;
}
}