Fix file_exists call to avoid open_basedir log message#39035
Merged
phil-davis merged 3 commits intomasterfrom Jul 20, 2021
Merged
Fix file_exists call to avoid open_basedir log message#39035phil-davis merged 3 commits intomasterfrom
phil-davis merged 3 commits intomasterfrom
Conversation
JammingBen
approved these changes
Jul 20, 2021
Contributor
JammingBen
left a comment
There was a problem hiding this comment.
Looks reasonable to me as \OC_App::getAppPath($app) . '/appinfo/routes.php' never evaluated to false.
Member
|
Well, concatenating It seems better. |
Contributor
Author
Yes, regardless of the "strange different behavior" of PHP 7.4.21 that caused this to be noticed, we should fix it anyway. The existing code was silly/wrong. |
Contributor
Author
|
I have looked through all the calls to |
|
Kudos, SonarCloud Quality Gate passed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
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.
The PHP 7.4.21 changelog https://www.php.net/ChangeLog-7.php has a fix https://bugs.php.net/bug.php?id=76359
The code of that is https://github.com/php/php-src/pull/7024/files
But I don't see exactly how that change is causing open_basedir to start complaining now.
Related Issue
OP has confirmed that fix works for them: #39034 (comment)
How Has This Been Tested?
CI
Types of changes
Checklist: