aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/URLGenerator.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/URLGenerator.php')
-rw-r--r--lib/private/URLGenerator.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index c0896ec3516..b432b0b69ca 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -122,12 +122,11 @@ class URLGenerator implements IURLGenerator {
public function linkTo(string $app, string $file, array $args = []): string {
$frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
- if($app !== '') {
+ if ($app !== '') {
$app_path = \OC_App::getAppPath($app);
// Check if the app is in the app folder
if ($app_path && file_exists($app_path . '/' . $file)) {
if (substr($file, -3) === 'php') {
-
$urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $app;
if ($frontControllerActive) {
$urlLinkTo = \OC::$WEBROOT . '/apps/' . $app;
@@ -170,7 +169,7 @@ class URLGenerator implements IURLGenerator {
public function imagePath(string $app, string $image): string {
$cache = $this->cacheFactory->createDistributed('imagePath-'.md5($this->getBaseUrl()).'-');
$cacheKey = $app.'-'.$image;
- if($key = $cache->get($cacheKey)) {
+ if ($key = $cache->get($cacheKey)) {
return $key;
}
@@ -186,7 +185,7 @@ class URLGenerator implements IURLGenerator {
$path = '';
$themingEnabled = $this->config->getSystemValue('installed', false) && \OCP\App::isEnabled('theming') && \OC_App::isAppLoaded('theming');
$themingImagePath = false;
- if($themingEnabled) {
+ if ($themingEnabled) {
$themingDefaults = \OC::$server->getThemingDefaults();
if ($themingDefaults instanceof ThemingDefaults) {
$themingImagePath = $themingDefaults->replaceImagePath($app, $image);
@@ -208,7 +207,7 @@ class URLGenerator implements IURLGenerator {
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.svg")
&& file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.png")) {
$path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
- } elseif($themingEnabled && $themingImagePath) {
+ } elseif ($themingEnabled && $themingImagePath) {
$path = $themingImagePath;
} elseif ($appPath && file_exists($appPath . "/img/$image")) {
$path = \OC_App::getAppWebPath($app) . "/img/$image";
@@ -227,7 +226,7 @@ class URLGenerator implements IURLGenerator {
$path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
}
- if($path !== '') {
+ if ($path !== '') {
$cache->set($cacheKey, $path);
return $path;
}
@@ -248,7 +247,7 @@ class URLGenerator implements IURLGenerator {
return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/') . '/' . ltrim($url, '/');
}
// The ownCloud web root can already be prepended.
- if(\OC::$WEBROOT !== '' && strpos($url, \OC::$WEBROOT) === 0) {
+ if (\OC::$WEBROOT !== '' && strpos($url, \OC::$WEBROOT) === 0) {
$url = substr($url, \strlen(\OC::$WEBROOT));
}