Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MODX 3 installation for database passwords with backslashes and quotes #16264

Merged
merged 1 commit into from Nov 2, 2022

Conversation

halftrainedharry
Copy link
Contributor

What does it do?

Only the value that is written to the config file is escaped, not the value in the code (that is later used to create the database connection).
addslashes is replaced by str_replace because double quotes (") shouldn't be escaped.

Why is it needed?

The MODX 3 installation fails at the action=install step, when the "Database password" contains a backslash, or a quote and shows a "Site temporarily unavailable." message.

How to test

Install MODX 3 with a "Database password" that contains a backslash, single or double quote and make sure the installation runs successfully.

Related issue(s)/PR(s)

Resolves #16261

@cla-bot cla-bot bot added the cla-signed CLA confirmed for contributors to this PR. label Sep 14, 2022
@Mark-H Mark-H added this to the v3.0.2 milestone Nov 2, 2022
@Ibochkarev Ibochkarev added the pr/review-needed Pull request requires review and testing. label Nov 2, 2022
@opengeek opengeek merged commit 61ccb7e into modxcms:3.x Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed CLA confirmed for contributors to this PR. pr/review-needed Pull request requires review and testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Site temporary unavailable" an error occurs during installation with a certain character in the password
4 participants