Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Share20/DefaultShareProvider.php')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index 627284da4e8..70f9b8665f9 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -1566,14 +1566,15 @@ class DefaultShareProvider implements IShareProvider {
/**
* Load from database format (JSON string) to IAttributes
*
- * @param IShare $share
- * @param string|null $data
- * @return IShare modified share
+ * @return IShare the modified share
*/
- private function updateShareAttributes(IShare $share, ?string $data) {
+ private function updateShareAttributes(IShare $share, ?string $data): IShare {
if ($data !== null && $data !== '') {
$attributes = new ShareAttributes();
$compressedAttributes = \json_decode($data, true);
+ if ($compressedAttributes === false || $compressedAttributes === null) {
+ return $share;
+ }
foreach ($compressedAttributes as $compressedAttribute) {
$attributes->setAttribute(
$compressedAttribute[0],
@@ -1589,11 +1590,8 @@ class DefaultShareProvider implements IShareProvider {
/**
* Format IAttributes to database format (JSON string)
- *
- * @param IAttributes|null $attributes
- * @return string|null
*/
- private function formatShareAttributes($attributes) {
+ private function formatShareAttributes(?IAttributes $attributes): ?string {
if ($attributes === null || empty($attributes->toArray())) {
return null;
}