Skip to content

Commit

Permalink
Use proper arg name in PublicRootCollection::getChild
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed May 7, 2024
1 parent 3a51b64 commit 1e65890
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Sabre/PublicRootCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ public function getChildForPrincipal(array $principalInfo): PublicAlbumRoot {
/**
* Returns a child object, by its token.
*
* @param string $token
* @param string $name
*
* @throws NotFound
*
* @return DAV\INode
*/
public function getChild($token) {
public function getChild($name) {
$this->throttler->sleepDelayOrThrowOnMax($this->request->getRemoteAddress(), self::BRUTEFORCE_ACTION);

if (is_null($token)) {
if (is_null($name)) {
throw new \Sabre\DAV\Exception\Forbidden();
}

$albums = $this->albumMapper->getSharedAlbumsForCollaboratorWithFiles($token, AlbumMapper::TYPE_LINK);
$albums = $this->albumMapper->getSharedAlbumsForCollaboratorWithFiles($name, AlbumMapper::TYPE_LINK);

if (count($albums) !== 1) {
$this->throttler->registerAttempt(self::BRUTEFORCE_ACTION, $this->request->getRemoteAddress());
Expand Down

0 comments on commit 1e65890

Please sign in to comment.