Skip to content

Commit

Permalink
remove heading slash on hashed path
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed May 11, 2023
1 parent 520ba25 commit 56f6c6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ACL/RuleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function getRulesForFilesByPath(IUser $user, int $storageId, array $fileP
$userMappings = $this->userMappingManager->getMappingsForUser($user);

$hashes = array_map(function (string $path): string {
return md5($path);
return md5(trim($path, '/'));
}, $filePaths);

$rows = [];
Expand Down Expand Up @@ -197,7 +197,7 @@ private function getId(int $storageId, string $path): int {
*/
public function getAllRulesForPaths(int $storageId, array $filePaths): array {
$hashes = array_map(function (string $path) {
return md5($path);
return md5(trim($path, '/'));
}, $filePaths);
$query = $this->connection->getQueryBuilder();
$query->select(['f.fileid', 'mapping_type', 'mapping_id', 'mask', 'a.permissions', 'path'])
Expand Down

0 comments on commit 56f6c6b

Please sign in to comment.