diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index c22c65f6c7b44..b5b5a5de36758 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -951,6 +951,10 @@ public function getSharedWith($userId, $shareType, $node, $limit, $offset) { $user = $this->userManager->get($userId); $allGroups = ($user instanceof IUser) ? $this->groupManager->getUserGroupIds($user) : []; + if ($allGroups === []) { + return []; + } + /** @var Share[] $shares2 */ $shares2 = []; diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php index 9e6e2056e6b32..1e3ebc329269b 100755 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -29,6 +29,7 @@ */ namespace OC\Template; +use OC\SystemConfig; use Psr\Log\LoggerInterface; abstract class ResourceLocator { @@ -42,6 +43,8 @@ abstract class ResourceLocator { protected LoggerInterface $logger; + private const LOG_LARGE_ASSET_OFFSET = 1024 * 1024; + public function __construct(LoggerInterface $logger) { $this->logger = $logger; $this->mapping = [ @@ -98,6 +101,10 @@ public function find($resources) { */ protected function appendIfExist($root, $file, $webRoot = null) { if ($root !== false && is_file($root.'/'.$file)) { + $systemConfig = \OCP\Server::get(SystemConfig::class); + if ($systemConfig->getValue('debug', false) && filesize($root.'/'.$file) > self::LOG_LARGE_ASSET_OFFSET) { + $this->logger->debug("$root/$file is larger then 1MB, consider reducing the size for javascript entrypoints"); + } $this->append($root, $file, $webRoot, false); return true; } diff --git a/tests/lib/Template/ResourceLocatorTest.php b/tests/lib/Template/ResourceLocatorTest.php index fa329ca6581e4..4d10b7c82f2bc 100644 --- a/tests/lib/Template/ResourceLocatorTest.php +++ b/tests/lib/Template/ResourceLocatorTest.php @@ -30,8 +30,13 @@ public function getResourceLocator($theme) { $systemConfig ->expects($this->any()) ->method('getValue') - ->with('theme', '') - ->willReturn($theme); + ->willReturnCallback(function($key, $default = null) use ($theme) { + if ($key === 'theme') { + return $theme; + } + + return $default; + }); $this->overwriteService(SystemConfig::class, $systemConfig); return $this->getMockForAbstractClass('OC\Template\ResourceLocator', [$this->logger],