MCPcopy Create free account
hub / github.com/error311/FileRise / isPathInsideOrSame

Method isPathInsideOrSame

src/FileRise/Domain/FolderModel.php:651–666  ·  view source on GitHub ↗
(string $rootReal, string $candidateReal)

Source from the content-addressed store, hash-verified

649 }
650
651 private static function isPathInsideOrSame(string $rootReal, string $candidateReal): bool
652 {
653 $root = rtrim($rootReal, DIRECTORY_SEPARATOR);
654 $candidate = rtrim($candidateReal, DIRECTORY_SEPARATOR);
655 if ($root === '' && $rootReal === DIRECTORY_SEPARATOR) {
656 $root = DIRECTORY_SEPARATOR;
657 }
658 if ($candidate === '' && $candidateReal === DIRECTORY_SEPARATOR) {
659 $candidate = DIRECTORY_SEPARATOR;
660 }
661 if ($root === '' || $candidate === '') {
662 return false;
663 }
664 $rootPrefix = $root === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : $root . DIRECTORY_SEPARATOR;
665 return $candidate === $root || str_starts_with($candidate . DIRECTORY_SEPARATOR, $rootPrefix);
666 }
667
668 public static function listChildren(string $folder, string $user, array $perms, ?string $cursor = null, int $limit = 500, bool $probe = true): array
669 {

Callers 7

resolveFolderPathMethod · 0.95
createFolderMethod · 0.95
getSharedFileInfoMethod · 0.95
uploadToSharedFolderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected