diff options
author | Antipkin-A <Artem.Antipkin@onlyoffice.com> | 2022-10-27 16:33:12 +0300 |
---|---|---|
committer | Antipkin-A <Artem.Antipkin@onlyoffice.com> | 2022-10-27 16:33:12 +0300 |
commit | d306e229b5fa5a3f35ead06dbe621df37a674abb (patch) | |
tree | f45242ec832477f741119c39e1e8c45beaf83489 | |
parent | 5fdf15850b57cdb6e509c253944569b23c4c1db6 (diff) |
fixed download attribute (Fix #734 Fix #733 Fix #725 Fix #724)
-rw-r--r-- | controller/editorapicontroller.php | 3 | ||||
-rw-r--r-- | controller/editorcontroller.php | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/controller/editorapicontroller.php b/controller/editorapicontroller.php index b8c2c7f..b7d6819 100644 --- a/controller/editorapicontroller.php +++ b/controller/editorapicontroller.php @@ -364,7 +364,8 @@ class EditorApiController extends OCSController { if (method_exists(IShare::class, "getAttributes")) { $share = empty($share) ? $fileStorage->getShare() : $share; $attributes = $share->getAttributes(); - if ($attributes !== null && !$attributes->getAttribute("permissions", "download")) { + $downloadAttr = isset($attributes) ? $attributes->getAttribute("permissions", "download") : null; + if (isset($downloadAttr) && !$downloadAttr) { $canDownload = false; } } diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 92e7b60..55bd84e 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -1053,7 +1053,8 @@ class EditorController extends Controller { if (method_exists(IShare::class, "getAttributes")) { $share = empty($share) ? $fileStorage->getShare() : $share; $attributes = $share->getAttributes(); - if ($attributes !== null && !$attributes->getAttribute("permissions", "download")) { + $downloadAttr = isset($attributes) ? $attributes->getAttribute("permissions", "download") : null; + if (isset($downloadAttr) && !$downloadAttr) { return $this->renderError($this->trans->t("Not permitted")); } } |