]> source.dussan.org Git - nextcloud-server.git/commitdiff
Empty string is returned as null, but empty string in file cache is the root and...
authorJoas Schilling <coding@schilljs.com>
Mon, 9 Nov 2020 15:26:09 +0000 (16:26 +0100)
committerJoas Schilling <coding@schilljs.com>
Thu, 12 Nov 2020 11:57:51 +0000 (12:57 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Files/Cache/Cache.php
lib/private/Share20/DefaultShareProvider.php

index e74cc86d9c9cdaf1158b7c91f526769ef43f7041..1d3b4da3bce0cd08fa0c62ccc3cb55af46dc09e7 100644 (file)
@@ -998,7 +998,11 @@ class Cache implements ICache {
                $path = $result->fetchColumn();
                $result->closeCursor();
 
-               return $path === false ? null : $path;
+               if ($path === false) {
+                       return null;
+               }
+
+               return (string) $path;
        }
 
        /**
index e43529086fd158d2061f4a17371e1461a3fa794d..b4ac3b3b84dce762924dbea647dd40bf12d0ce3e 100644 (file)
@@ -874,6 +874,11 @@ class DefaultShareProvider implements IShareProvider {
                        $cursor = $qb->execute();
 
                        while ($data = $cursor->fetch()) {
+                               if ($data['fileid'] && $data['path'] === null) {
+                                       $data['path'] = (string) $data['path'];
+                                       $data['name'] = (string) $data['name'];
+                                       $data['checksum'] = (string) $data['checksum'];
+                               }
                                if ($this->isAccessibleResult($data)) {
                                        $shares[] = $this->createShare($data);
                                }
@@ -1004,7 +1009,7 @@ class DefaultShareProvider implements IShareProvider {
                        ->setShareType((int)$data['share_type'])
                        ->setPermissions((int)$data['permissions'])
                        ->setTarget($data['file_target'])
-                       ->setNote($data['note'])
+                       ->setNote((string)$data['note'])
                        ->setMailSend((bool)$data['mail_send'])
                        ->setStatus((int)$data['accepted'])
                        ->setLabel($data['label']);