mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 08:16:43 -04:00
Don't setup the filesystem to check for a favicon we don't use anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
7aa440b51d
commit
04145b23c9
1 changed files with 11 additions and 8 deletions
|
|
@ -44,6 +44,7 @@ namespace OCA\Theming;
|
|||
use OCP\App\AppPathNotFoundException;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\Files\SimpleFS\ISimpleFile;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -348,17 +349,11 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
}
|
||||
$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
|
||||
|
||||
try {
|
||||
$customFavicon = $this->imageManager->getImage('favicon');
|
||||
} catch (NotFoundException $e) {
|
||||
$customFavicon = null;
|
||||
}
|
||||
|
||||
$route = false;
|
||||
if ($image === 'favicon.ico' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
|
||||
if ($image === 'favicon.ico' && ($this->imageManager->shouldReplaceIcons() || $this->getCustomFavicon() !== null)) {
|
||||
$route = $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]);
|
||||
}
|
||||
if (($image === 'favicon-touch.png' || $image === 'favicon-fb.png') && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
|
||||
if (($image === 'favicon-touch.png' || $image === 'favicon-fb.png') && ($this->imageManager->shouldReplaceIcons() || $this->getCustomFavicon() !== null)) {
|
||||
$route = $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]);
|
||||
}
|
||||
if ($image === 'manifest.json') {
|
||||
|
|
@ -382,6 +377,14 @@ class ThemingDefaults extends \OC_Defaults {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected function getCustomFavicon(): ?ISimpleFile {
|
||||
try {
|
||||
return $this->imageManager->getImage('favicon');
|
||||
} catch (NotFoundException $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the cache buster key
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue