public: allow empty foldersPath (fix #550)

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
pull/579/head
Varun Patil 2023-04-16 15:58:28 -07:00
parent 83be3c93b1
commit 14011dc5fd
1 changed files with 3 additions and 1 deletions

View File

@ -193,7 +193,9 @@ class PublicController extends AuthPublicShareController
$relPath = substr($node->getPath(), \strlen($userFolder->getPath()));
// Get the user's folders path
$foldersPath = $this->config->getUserValue($user->getUID(), Application::APPNAME, 'foldersPath', '/');
$foldersPath = $this->config->getUserValue($user->getUID(), Application::APPNAME, 'foldersPath', '');
$foldersPath = $foldersPath ?: '/';
$foldersPath = \OCA\Memories\Exif::sanitizePath($foldersPath);
// Check if relPath starts with foldersPath
if (0 !== strpos($relPath, $foldersPath)) {