diff options
author | Karel Hink <info@karelhink.cz> | 2021-07-30 19:28:52 +0000 |
---|---|---|
committer | Karel Hink <info@karelhink.cz> | 2021-07-30 19:28:52 +0000 |
commit | 18cc6c11b51b94ef0e2be55a0cf11de920b87870 (patch) | |
tree | 47cd6e9e85560720b3c0184024b43962156f50a5 /lib/private/Template | |
parent | 7170c03f0e11a2f7385d909cd0b98f90e0ce984c (diff) | |
download | nextcloud-server-18cc6c11b51b94ef0e2be55a0cf11de920b87870.tar.gz nextcloud-server-18cc6c11b51b94ef0e2be55a0cf11de920b87870.zip |
Fix Lots of Error: file_exists(): open_basedir restriction in effect. in Log
Signed-off-by: Karel Hink <info@karelhink.cz>
Diffstat (limited to 'lib/private/Template')
-rw-r--r-- | lib/private/Template/Base.php | 2 | ||||
-rw-r--r-- | lib/private/Template/IconsCacher.php | 5 | ||||
-rwxr-xr-x | lib/private/Template/ResourceLocator.php | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index 2087f5f8ed9..2de8c7ad5b1 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 e379a8ed92d..01500aa2e9c 100644 --- a/lib/private/Template/IconsCacher.php +++ b/lib/private/Template/IconsCacher.php @@ -170,7 +170,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)) { [,$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 3f3299e2e84..3ca34259907 100755 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -102,7 +102,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; } |