diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-04-10 16:11:57 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-04-10 16:11:57 +0200 |
commit | e512a69a59cb60660a7afc8b72b3196d3be0c514 (patch) | |
tree | d4d8e9410671ce7256fda552277dbbf87cfca8fa /lib/private | |
parent | 7b2d53603c4410ec9d66826caf3c49c53644dffc (diff) | |
parent | fbb84a518f3aaf5491875ae3adfdcf1d05066ef1 (diff) | |
download | nextcloud-server-e512a69a59cb60660a7afc8b72b3196d3be0c514.tar.gz nextcloud-server-e512a69a59cb60660a7afc8b72b3196d3be0c514.zip |
Merge pull request #15395 from owncloud/fix-imagepath
Fix UrlGenerator::imagePath() for app paths
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/urlgenerator.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index f090dd51b6e..104cf7df596 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -149,6 +149,8 @@ class URLGenerator implements IURLGenerator { //if a theme has a png but not an svg always use the png $basename = substr(basename($image),0,-4); + $appPath = \OC_App::getAppPath($app); + // Check if the app is in the app folder $path = ''; if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { @@ -156,11 +158,11 @@ 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 (file_exists(\OC_App::getAppPath($app) . "/img/$image")) { + } elseif ($appPath && file_exists($appPath . "/img/$image")) { $path = \OC_App::getAppWebPath($app) . "/img/$image"; - } elseif (!file_exists(\OC_App::getAppPath($app) . "/img/$basename.svg") - && file_exists(\OC_App::getAppPath($app) . "/img/$basename.png")) { - $path = \OC_App::getAppPath($app) . "/img/$basename.png"; + } 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") |