Opened 8 years ago
Closed 8 years ago
#30869 closed defect (bug) (duplicate)
Output of esc_url doesn't allow brackets
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Formatting | Keywords: | |
Focuses: | Cc: |
Description
$args = array( 'autofocus[control]' => 'blogname', ); $url = add_query_arg( $args, admin_url('customize.php' )); echo esc_url($url);
Current output:
http://staging.dev/wp-admin/customize.php?autofocuscontrol=blogname
Expected output:
http://staging.dev/wp-admin/customize.php?autofocus[control]=blogname
I was trying to generate auto focus URL for customize page. I generally use esc_url
to escape any URL in WordPress. But I could not produce expected URL when URL is escaped with the function. Is this expected feature of the function? Can someone please help make me clear about this?
Thanks.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Here is a patch with unit tests to fix the issue; all other formatting unit tests continue passing. It appears the regex pattern was introduced in #12309 and hasn't changed since.