diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-07 12:55:05 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-09 09:44:32 +0100 |
commit | 2d7d8ca12513c24d59da8b7262f7e8a9fceb9396 (patch) | |
tree | 09a2253abcf5b95a2c596355e8af42ee2ffb4d62 /lib/private | |
parent | d1547ee3b07b6a553dbbb4bcdd03f0d348b23156 (diff) | |
download | nextcloud-server-2d7d8ca12513c24d59da8b7262f7e8a9fceb9396.tar.gz nextcloud-server-2d7d8ca12513c24d59da8b7262f7e8a9fceb9396.zip |
Check if the cached js file exists
Fixes #8705
If the file does not exist (for whatever reason). It is never cached. No
matter what the depscache etc tell you.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Template/JSCombiner.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php index c5adcee6854..bc548c22fd0 100644 --- a/lib/private/Template/JSCombiner.php +++ b/lib/private/Template/JSCombiner.php @@ -104,13 +104,20 @@ class JSCombiner { * @return bool */ protected function isCached($fileName, ISimpleFolder $folder) { - $fileName = str_replace('.json', '.js', $fileName) . '.deps'; + $fileName = str_replace('.json', '.js', $fileName); + + if (!$folder->fileExists($fileName)) { + return false; + } + + $fileName = $fileName . '.deps'; try { $deps = $this->depsCache->get($folder->getName() . '-' . $fileName); if ($deps === null || $deps === '') { $depFile = $folder->getFile($fileName); $deps = $depFile->getContent(); } + // check again if ($deps === null || $deps === '') { $this->logger->info('JSCombiner: deps file empty: ' . $fileName); |