Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files/lib/Controller/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected function renderScript($appName, $scriptName) {
$content = '';
$appPath = \OC_App::getAppPath($appName);
$scriptPath = $appPath . '/' . $scriptName;
if (\file_exists($scriptPath)) {
if ($appPath !== false && \file_exists($scriptPath)) {
// TODO: sanitize path / script name ?
\ob_start();
include $scriptPath;
Expand Down
11 changes: 11 additions & 0 deletions changelog/unreleased/39034
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Bugfix: avoid potential open_basedir errors after upgrade to PHP 7.4.21

PHP 7.4.21 checks open_basedir settings more exactly. Calls to file_exists can
emit log messages like "file_exists(): open_basedir restriction in effect" that
were not emitted by PHP 7.4.20.

This change fixes an incorrect file_exists check. The open_basedir message will
no longer be emitted in this case.

https://github.com/owncloud/core/issues/39034
https://github.com/owncloud/core/pull/39035
4 changes: 2 additions & 2 deletions lib/private/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static function updateApp($info= [], $isShipped=false) {
$info = self::checkAppsIntegrity($info, $extractDir, $path, $isShipped);

$currentDir = OC_App::getAppPath($info['id']);
if (\is_dir("$currentDir/.git")) {
if ($currentDir !== false && \is_dir("$currentDir/.git")) {
throw new AppAlreadyInstalledException("App <{$info['id']}> is a git clone - it will not be updated.");
}

Expand Down Expand Up @@ -529,7 +529,7 @@ public static function installShippedApp($app) {
$ms = new MigrationService($app, \OC::$server->getDatabaseConnection());
$ms->migrate();
} else {
if (\is_file($appPath.'/appinfo/database.xml')) {
if ($appPath !== false && \is_file($appPath.'/appinfo/database.xml')) {
\OC::$server->getLogger()->debug('Create app database from schema file');
OC_DB::createDbFromStructure($appPath . '/appinfo/database.xml');
}
Expand Down
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 settings/Controller/SettingsPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function getIconForSettingsPanel($section) {
$icon = $section->getIconName() . '.svg';
$appPath = \OC_App::getAppPath($section->getID());

if (\file_exists($appPath . '/img/' . $icon)) {
if ($appPath !== false && \file_exists($appPath . '/img/' . $icon)) {
$icon = $this->urlGenerator->imagePath($section->getID(), $icon);
} else {
$icon = $section->getIconName();
Expand Down