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

dev/core#2663 - Setup - Consistently handle special characters per URL conventions #20713

Merged
merged 1 commit into from
Jun 27, 2021

Conversation

totten
Copy link
Member

@totten totten commented Jun 25, 2021

Overview

This addresses a problem with the setup UI when installing CiviCRM with certain database credentials. Specifically, it handles special characters more correctly.

https://lab.civicrm.org/dev/core/-/issues/2663

Before

If the database password requires any special characters (e.g. "#" or "&"), then it is impossible to enter them correctly.

There are two ways you might try to enter a password like top#secret (e.g. plain mysql://myuser:top#secret...or URL-encoded mysql://myuser:top%23secret...). Neither of these work. (e.g. The URL-encoded notation won't pass the validator. The plain notation might pass the validator, but it won't be written correctly to disk.)

After

You may use special characters, as long as the URL is properly encoded, e.g. mysql://myuser:top%23secret...

Additionally, there is some help text pointing this out. (Highlighted in screenshot.)

Screen Shot 2021-06-25 at 3 33 31 PM

@civibot
Copy link

civibot bot commented Jun 25, 2021

(Standard links)

@civibot civibot bot added the master label Jun 25, 2021
@totten
Copy link
Member Author

totten commented Jun 25, 2021

Note: There was a small UI quirk in how the initial commit displayed the server:port. (The : was incorrectly escaped.) Force-pushed a fix and updated the screenshot.

…L conventions

Overview
--------

This addresses a problem with the setup UI when installing CiviCRM with certain database credentials.
Specifically, it handles special characters more correctly.

https://lab.civicrm.org/dev/core/-/issues/2663

Before
------

If the database password requires any special characters (e.g. "#" or "&"), then they cannot correctly
entered.

There are two ways you might try to enter a password (e.g.  plain
`mysql://myuser:top#secret...`or URL-encoded `mysql://myuser:top%23secret...`). Neither
of these work. (The plain notation might pass the validator, but it won't be written correctly to disk.
The URL-encoded notation won't pass the validator.)

After
-----

You may use special characters, as long as the URL is properly encoded, e.g. `mysql://myuser:top%23secret...`
@kcristiano
Copy link
Member

Thanks @totten

I did r-run on WP and Drupal.

mysql://wpcv:wp#cv@localhost/d7empty Fails as expected

mysql://wpcv:wp%23cv@localhost/d7empty Succeeds

I think the messaging is fine. This looks good to merge.

@seamuslee001
Copy link
Contributor

merging as per review by @kcristiano

@seamuslee001 seamuslee001 merged commit 947f718 into civicrm:master Jun 27, 2021
@totten
Copy link
Member Author

totten commented Jun 28, 2021

Thanks @kcristiano @seamuslee001

@totten totten deleted the 5.39-setup-url branch June 28, 2021 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants