summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-23 11:46:03 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-23 11:46:03 +0200
commit862d8f43e5d89a2549d6ffb324e4450bc0fd536d (patch)
treec508779cdaa5aa979bac203bcb4cb185e4fbe345
parentdec3f9ebcbdeacf5bc483df93900b157a1a5e546 (diff)
parent1bc5eb111b890873f81f2d0607cbde89c9a00895 (diff)
downloadnextcloud-server-862d8f43e5d89a2549d6ffb324e4450bc0fd536d.tar.gz
nextcloud-server-862d8f43e5d89a2549d6ffb324e4450bc0fd536d.zip
Merge pull request #24766 from owncloud/mmccarn-patch-2
Update imagePath to prefer theme, then app, then core images
-rw-r--r--lib/private/URLGenerator.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index 327c0c32dfe..9c4b0ff0864 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -159,28 +159,31 @@ class URLGenerator implements IURLGenerator {
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.svg")
&& file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.png")) {
$path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$basename.png";
- } elseif ($appPath && file_exists($appPath . "/img/$image")) {
- $path = \OC_App::getAppWebPath($app) . "/img/$image";
- } elseif ($appPath && !file_exists($appPath . "/img/$basename.svg")
- && file_exists($appPath . "/img/$basename.png")) {
- $path = \OC_App::getAppWebPath($app) . "/img/$basename.png";
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) {
$path = \OC::$WEBROOT . "/themes/$theme/$app/img/$image";
} elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$basename.svg")
&& file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$basename.png"))) {
$path = \OC::$WEBROOT . "/themes/$theme/$app/img/$basename.png";
- } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) {
- $path = \OC::$WEBROOT . "/$app/img/$image";
- } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/$app/img/$basename.svg")
- && file_exists(\OC::$SERVERROOT . "/$app/img/$basename.png"))) {
- $path = \OC::$WEBROOT . "/$app/img/$basename.png";
} elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$image")) {
$path = \OC::$WEBROOT . "/themes/$theme/core/img/$image";
} 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 ($appPath && file_exists($appPath . "/img/$image")) {
+ $path = \OC_App::getAppWebPath($app) . "/img/$image";
+ } elseif ($appPath && !file_exists($appPath . "/img/$basename.svg")
+ && file_exists($appPath . "/img/$basename.png")) {
+ $path = \OC_App::getAppWebPath($app) . "/img/$basename.png";
+ } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) {
+ $path = \OC::$WEBROOT . "/$app/img/$image";
+ } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/$app/img/$basename.svg")
+ && file_exists(\OC::$SERVERROOT . "/$app/img/$basename.png"))) {
+ $path = \OC::$WEBROOT . "/$app/img/$basename.png";
} elseif (file_exists(\OC::$SERVERROOT . "/core/img/$image")) {
$path = \OC::$WEBROOT . "/core/img/$image";
+ } elseif (!file_exists(\OC::$SERVERROOT . "/core/img/$basename.svg")
+ && file_exists(\OC::$SERVERROOT . "/core/img/$basename.png")) {
+ $path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
}
if($path !== '') {