#63632 closed defect (bug) (fixed)
Consider filtered URLs with arg in `wp_customize_url`
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | minor | Version: | 3.4.1 |
| Component: | Customize | Keywords: | has-patch has-unit-tests |
| Focuses: | administration | Cc: |
Description
The wp_customize_url function is setting the query string without proper handling of the URL that it receives from admin_url( 'customize.php' ). This leads to issues when the resulting URL contains a query string value. For example:
[...]/customize.php?my_custom_arg?theme=[theme_name]
When this happens it might generate a loop that results in the browser halting the page load with an error.
Attachments (1)
Change History (13)
This ticket was mentioned in PR #9102 on WordPress/wordpress-develop by @xipasduarte.
8 months ago
#1
- Keywords has-patch has-unit-tests added
#2
follow-up:
↓ 3
@
8 months ago
- Milestone changed from Awaiting Review to 6.9
@xipasduarte Thanks for reporting this. It makes sense to me. However, do you have an example where the URL has an initial query string? I know it. Would be introduced with filtering the admin URL, but is this an issue with any existing plugins or themes (or sites)?
#3
in reply to:
↑ 2
@
8 months ago
Thanks for the feedback @westonruter. I have an existing case in a plugin my company develops. It is meant as a translations plugin and we inject the param in the URL as a fallback mechanism for language detection. By doing this we broke the customizer link.
This is the plugin: https://github.com/26B/unbabble
It's not yet in the repository and we could kind of go around it and edit this link after, in another hook, but it made sense to me have this fixed in core, if any others need this. It seems to be what would be expected.
#6
follow-up:
↓ 7
@
7 months ago
- Keywords changes-requested added
@xipasduarte Thanks for the PR! I added a review. Feel free to skip also attaching a diff file to Trac. I personally almost always use GitHub branches when preparing commits for SVN, so keeping all your changes in the PR is just fine.
#7
in reply to:
↑ 6
@
7 months ago
@westonruter Thanks for the review. I believe I addressed everything and also added a few more tests. Take a look and let me know if we need to change anything else.
This ticket was mentioned in PR #9316 on WordPress/wordpress-develop by @mukesh27.
7 months ago
#10
Trac ticket: https://core.trac.wordpress.org/ticket/63632
Follow-up to https://core.trac.wordpress.org/changeset/60499 commit.
Adds theme arg using
add_query_argand takes care to remove any existing aruments with the same key.Trac ticket: [](https://core.trac.wordpress.org/ticket/63632)