apibase: check share readable
parent
1a9d229b95
commit
6db1752359
|
@ -106,7 +106,7 @@ class ApiBase extends Controller
|
||||||
// Public shared folder
|
// Public shared folder
|
||||||
if ($token = $this->getShareToken()) {
|
if ($token = $this->getShareToken()) {
|
||||||
$share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found
|
$share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found
|
||||||
if (!$share instanceof Folder) {
|
if (!$share instanceof Folder || !$share->isReadable() || !$share->isShareable()) {
|
||||||
throw new \Exception('Share not found or invalid');
|
throw new \Exception('Share not found or invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ class ApiBase extends Controller
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found
|
$share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found
|
||||||
if (!$share instanceof Folder) {
|
if (!$share instanceof Folder || !$share->isReadable() || !$share->isShareable()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
Loading…
Reference in New Issue