Skip to content

Comments

[4.4] Can't call File::write() with string-literal#40514

Merged
laoneo merged 1 commit intojoomla:4.4-devfrom
Hackwar:4.4-file-installer
May 2, 2023
Merged

[4.4] Can't call File::write() with string-literal#40514
laoneo merged 1 commit intojoomla:4.4-devfrom
Hackwar:4.4-file-installer

Conversation

@Hackwar
Copy link
Member

@Hackwar Hackwar commented Apr 30, 2023

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 for File::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.php in checkRemoteDbHost() 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

@richard67
Copy link
Member

I have tested this item ✅ successfully on 24b3306

Important hint for other testers:

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.

@ChristineWk
Copy link

I have tested this item ✅ successfully on 24b3306

With Prebuilt Package


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40514.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40514.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 1, 2023
@richard67 richard67 added the bug label May 1, 2023
@laoneo laoneo merged commit ac55ac9 into joomla:4.4-dev May 2, 2023
@laoneo
Copy link
Member

laoneo commented May 2, 2023

Thanks!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 2, 2023
@laoneo laoneo added this to the Joomla! 4.4.0 milestone May 2, 2023
@Hackwar Hackwar deleted the 4.4-file-installer branch March 22, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants