[4.4] Can't call File::write() with string-literal#40514
Merged
laoneo merged 1 commit intojoomla:4.4-devfrom May 2, 2023
Merged
[4.4] Can't call File::write() with string-literal#40514laoneo merged 1 commit intojoomla:4.4-devfrom
laoneo merged 1 commit intojoomla:4.4-devfrom
Conversation
4 tasks
Member
|
I have tested this item ✅ successfully on 24b3306 When having done the test without the patch to reproduce the issue, you should either delete the session cookie with your broswer's developer tools or close the browser window to make sure that the browser session is cleared before testing the patch. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40514. |
|
I have tested this item ✅ successfully on 24b3306 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40514. |
Member
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40514. |
Member
|
Thanks! |
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.
Pull Request for Issue #40503 .
Summary of Changes
This is the PR to fix this in 4.4-dev. When installing Joomla on a different database server than localhost, a check is done to ensure that you are really the person having control over the server. This check writes a file to the filesystem and the content is empty. The code called
File::write()with the string-literal, which is not valid, since you can't hand over a string-literal by reference. This PR first creates a variable, which then is handed over as the content forFile::write().Testing Instructions
Install Joomla 4.4-dev on a system and don't use localhost as your database server. Alternatively modify
installation/src/Helper/DatabaseHelper.phpincheckRemoteDbHost()to execute the check even though you are installing to localhost.Actual result BEFORE applying this Pull Request
You get a red warning in the browser.
Expected result AFTER applying this Pull Request
Installation passes without error messages.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed