summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-03-15 17:45:30 +0100
committerGitHub <noreply@github.com>2021-03-15 17:45:30 +0100
commite559afb8d409f75fdf9a216428d858d08aa1ee03 (patch)
treeafea41e1f4cf5f9f25070e819ef9637267c63ec0 /lib/private/Share20
parentf512705f8f3ba7ff676b139bbfc00dcf6d277bd1 (diff)
parent6ecf33bfe7ef719cd979de5b29fc1da02e255632 (diff)
downloadnextcloud-server-e559afb8d409f75fdf9a216428d858d08aa1ee03.tar.gz
nextcloud-server-e559afb8d409f75fdf9a216428d858d08aa1ee03.zip
Merge pull request #25136 from nextcloud/cachejail-search-filter
do cachejail search filtering in sql
Diffstat (limited to 'lib/private/Share20')
-rw-r--r--lib/private/Share20/Share.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php
index 69f36edf4f3..87f77701ee2 100644
--- a/lib/private/Share20/Share.php
+++ b/lib/private/Share20/Share.php
@@ -30,8 +30,9 @@
namespace OC\Share20;
-use OCP\Files\Cache\ICacheEntry;
use OCP\Files\File;
+use OCP\Files\Cache\ICacheEntry;
+use OCP\Files\FileInfo;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
@@ -233,8 +234,13 @@ class Share implements \OCP\Share\IShare {
*/
public function getNodeType() {
if ($this->nodeType === null) {
- $node = $this->getNode();
- $this->nodeType = $node instanceof File ? 'file' : 'folder';
+ if ($this->getNodeCacheEntry()) {
+ $info = $this->getNodeCacheEntry();
+ $this->nodeType = $info->getMimeType() === FileInfo::MIMETYPE_FOLDER ? 'folder' : 'file';
+ } else {
+ $node = $this->getNode();
+ $this->nodeType = $node instanceof File ? 'file' : 'folder';
+ }
}
return $this->nodeType;