Skip to content

Commit 75021cd

Browse files
authored
Merge pull request #29016 from nextcloud/backport/28263/stable22
[stable22] Fix Lots of Error: file_exists(): open_basedir restriction in effect.…
2 parents 5128ebd + 5b36f44 commit 75021cd

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

lib/private/Route/Router.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ public function loadRoutes($app = null) {
130130
if (isset($this->loadedApps[$app])) {
131131
return;
132132
}
133-
$file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
134-
if ($file !== false && file_exists($file)) {
133+
$appPath = \OC_App::getAppPath($app);
134+
$file = $appPath . '/appinfo/routes.php';
135+
if ($appPath !== false && file_exists($file)) {
135136
$routingFiles = [$app => $file];
136137
} else {
137138
$routingFiles = [];

lib/private/Template/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct($template, $requestToken, $l10n, $theme) {
6565
*/
6666
protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) {
6767
// Check if the app is in the app folder or in the root
68-
if (file_exists($app_dir.'/templates/')) {
68+
if ($app_dir !== false && file_exists($app_dir.'/templates/')) {
6969
return [
7070
$serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/',
7171
$app_dir.'/templates/',

lib/private/Template/IconsCacher.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ private function parseUrl($url): array {
170170
} elseif (\strpos($url, $base) === 0) {
171171
if (\preg_match('/([A-z0-9\_\-]+)\/([a-zA-Z0-9-_\~\/\.\=\:\;\+\,]+)\?color=([0-9a-fA-F]{3,6})/', $cleanUrl, $matches)) {
172172
[,$app,$cleanUrl, $color] = $matches;
173-
$location = \OC_App::getAppPath($app) . '/img/' . $cleanUrl . '.svg';
173+
$appPath = \OC_App::getAppPath($app);
174+
if ($appPath !== false) {
175+
$location = $appPath . '/img/' . $cleanUrl . '.svg';
176+
}
174177
if ($app === 'settings') {
175178
$location = \OC::$SERVERROOT . '/settings/img/' . $cleanUrl . '.svg';
176179
}

lib/private/Template/ResourceLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function find($resources) {
102102
* @return bool True if the resource was found, false otherwise
103103
*/
104104
protected function appendIfExist($root, $file, $webRoot = null) {
105-
if (is_file($root.'/'.$file)) {
105+
if ($root !== false && is_file($root.'/'.$file)) {
106106
$this->append($root, $file, $webRoot, false);
107107
return true;
108108
}

0 commit comments

Comments
 (0)