Skip to content

Commit 5ef1aa5

Browse files
CarlSchwanbackportbot[bot]
authored andcommitted
fix: Ensure we don't get share by empty name
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent a4ba3ba commit 5ef1aa5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/private/Share20/Manager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,10 +1396,11 @@ public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50)
13961396
* @throws ShareNotFound
13971397
*/
13981398
public function getShareByToken($token) {
1399-
// tokens cannot be valid local user names
1400-
if ($this->userManager->userExists($token)) {
1399+
// tokens cannot be valid local usernames or empty
1400+
if ($token === '' || $this->userManager->userExists($token)) {
14011401
throw new ShareNotFound();
14021402
}
1403+
14031404
$share = null;
14041405
try {
14051406
if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {

0 commit comments

Comments
 (0)