diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-03-15 17:45:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 17:45:30 +0100 |
commit | e559afb8d409f75fdf9a216428d858d08aa1ee03 (patch) | |
tree | afea41e1f4cf5f9f25070e819ef9637267c63ec0 /lib/private/Share20 | |
parent | f512705f8f3ba7ff676b139bbfc00dcf6d277bd1 (diff) | |
parent | 6ecf33bfe7ef719cd979de5b29fc1da02e255632 (diff) | |
download | nextcloud-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.php | 12 |
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; |