summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Hink <info@karelhink.cz>2021-07-30 19:28:52 +0000
committerKarel Hink <info@karelhink.cz>2021-10-02 13:51:42 +0200
commit30905d234026ca247be2c3f487f0c75ff6974e84 (patch)
tree11e2042111a83d3e17669b55dd9a0689c933106b /lib
parenta2e5fee21fc9b510d1d08473893783b8eac2aff4 (diff)
downloadnextcloud-server-30905d234026ca247be2c3f487f0c75ff6974e84.tar.gz
nextcloud-server-30905d234026ca247be2c3f487f0c75ff6974e84.zip
backport of #28263
Signed-off-by: Karel Hink <info@karelhink.cz>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Route/Router.php5
-rw-r--r--lib/private/Template/Base.php2
-rw-r--r--lib/private/Template/IconsCacher.php5
-rwxr-xr-xlib/private/Template/ResourceLocator.php2
4 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index 71bc4a6c4f7..9f592bcb674 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -131,8 +131,9 @@ class Router implements IRouter {
if (isset($this->loadedApps[$app])) {
return;
}
- $file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
- if ($file !== false && file_exists($file)) {
+ $appPath = \OC_App::getAppPath($app);
+ $file = $appPath . '/appinfo/routes.php';
+ if ($appPath !== false && file_exists($file)) {
$routingFiles = [$app => $file];
} else {
$routingFiles = [];
diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php
index 65d0ad469ff..a42ddccbc00 100644
--- a/lib/private/Template/Base.php
+++ b/lib/private/Template/Base.php
@@ -65,7 +65,7 @@ class Base {
*/
protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) {
// Check if the app is in the app folder or in the root
- if (file_exists($app_dir.'/templates/')) {
+ if ($app_dir !== false && file_exists($app_dir.'/templates/')) {
return [
$serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/',
$app_dir.'/templates/',
diff --git a/lib/private/Template/IconsCacher.php b/lib/private/Template/IconsCacher.php
index 9b80711dd29..a3318c61d47 100644
--- a/lib/private/Template/IconsCacher.php
+++ b/lib/private/Template/IconsCacher.php
@@ -171,7 +171,10 @@ class IconsCacher {
} elseif (\strpos($url, $base) === 0) {
if (\preg_match('/([A-z0-9\_\-]+)\/([a-zA-Z0-9-_\~\/\.\=\:\;\+\,]+)\?color=([0-9a-fA-F]{3,6})/', $cleanUrl, $matches)) {
list(,$app,$cleanUrl, $color) = $matches;
- $location = \OC_App::getAppPath($app) . '/img/' . $cleanUrl . '.svg';
+ $appPath = \OC_App::getAppPath($app);
+ if ($appPath !== false) {
+ $location = $appPath . '/img/' . $cleanUrl . '.svg';
+ }
if ($app === 'settings') {
$location = \OC::$SERVERROOT . '/settings/img/' . $cleanUrl . '.svg';
}
diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php
index 1d9f60cf5dd..a6f9f63ef7d 100755
--- a/lib/private/Template/ResourceLocator.php
+++ b/lib/private/Template/ResourceLocator.php
@@ -103,7 +103,7 @@ abstract class ResourceLocator {
* @return bool True if the resource was found, false otherwise
*/
protected function appendIfExist($root, $file, $webRoot = null) {
- if (is_file($root.'/'.$file)) {
+ if ($root !== false && is_file($root.'/'.$file)) {
$this->append($root, $file, $webRoot, false);
return true;
}