Skip to content

Commit f315c53

Browse files
authored
Merge pull request #63856 from nextcloud/backport/34548656ad139818d8789c1e6adf37998d3d6829
[stable32] fix: Ensure we don't get share by empty name
2 parents eead805 + 61f86a6 commit f315c53

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
@@ -1451,10 +1451,11 @@ public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50)
14511451
* @throws ShareNotFound
14521452
*/
14531453
public function getShareByToken($token) {
1454-
// tokens cannot be valid local user names
1455-
if ($this->userManager->userExists($token)) {
1454+
// tokens cannot be valid local usernames or empty
1455+
if ($token === '' || $this->userManager->userExists($token)) {
14561456
throw new ShareNotFound();
14571457
}
1458+
14581459
$share = null;
14591460
try {
14601461
if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {

0 commit comments

Comments
 (0)