Skip to content

Commit

Permalink
Merge pull request #28263 from Hinyka/bugfix/27759
Browse files Browse the repository at this point in the history
Fix Lots of Error: file_exists(): open_basedir restriction in effect.…
  • Loading branch information
PVince81 authored Oct 1, 2021
2 parents 4737708 + 18cc6c1 commit fb2fd34
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/private/Route/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public function loadRoutes($app = null) {
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 = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Template/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct($template, $requestToken, $l10n, $theme) {
*/
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/',
Expand Down
5 changes: 4 additions & 1 deletion lib/private/Template/IconsCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ private function parseUrl($url): array {
} 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';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Template/ResourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function find($resources) {
* @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;
}
Expand Down

0 comments on commit fb2fd34

Please sign in to comment.