Robin Appelman 1 week ago
committed by GitHub
parent
commit
fb87e1baaa
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      lib/private/Files/Cache/Wrapper/CacheJail.php
  2. 2
      lib/private/Files/Cache/Wrapper/CacheWrapper.php
  3. 3
      lib/private/Files/View.php

6
lib/private/Files/Cache/Wrapper/CacheJail.php

@ -92,7 +92,11 @@ class CacheJail extends CacheWrapper {
protected function formatCacheEntry($entry) {
if (isset($entry['path'])) {
$entry['path'] = $this->getJailedPath($entry['path']);
$sourcePath = $entry['path'];
$entry['path'] = $this->getJailedPath($sourcePath);
if (is_null($entry['path'])) {
$this->logger->error("'$sourcePath' is not inside jail path {$this->root}", ['entry' => $entry]);
}
}
return $entry;
}

2
lib/private/Files/Cache/Wrapper/CacheWrapper.php

@ -27,6 +27,7 @@ class CacheWrapper extends Cache {
$this->mimetypeLoader = $cache->mimetypeLoader;
$this->connection = $cache->connection;
$this->querySearchHelper = $cache->querySearchHelper;
$this->logger = $cache->logger;
} else {
if (!$dependencies) {
$dependencies = Server::get(CacheDependencies::class);
@ -34,6 +35,7 @@ class CacheWrapper extends Cache {
$this->mimetypeLoader = $dependencies->getMimeTypeLoader();
$this->connection = $dependencies->getConnection();
$this->querySearchHelper = $dependencies->getQuerySearchHelper();
$this->logger = $dependencies->getLogger();
}
}

3
lib/private/Files/View.php

@ -1527,6 +1527,9 @@ class View {
if ($sharingDisabled) {
$content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}
if (is_null($content['path'])) {
throw new \Exception('Directory listing of "' . $path . '" contains item with null path (' . $content['fileid'] . ')');
}
$ownerId = $storage->getOwner($content['path']);
if ($ownerId !== false) {
$owner = $this->getUserObjectForOwner($ownerId);

Loading…
Cancel
Save