#53293 closed defect (bug) (worksforme)
add_query_arg returning a bad character
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 5.7.2 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
When add_query_arg is used with "not" at the beginning of a key (excluding the first parameter), the function seems to replace "¬" by "¬".
For example:
add_query_arg( array( 'note1'=>'test', 'note2'=>'test', 'note3'=>'test', ),'example.com');
returns "example.com?note1=test¬e2=test¬e3=test"
Change History (3)
#2
in reply to:
↑ 1
@
4 years ago
- Resolution set to worksforme
- Status changed from new to closed
Replying to SergeyBiryukov
Hello Sergey,
Thank you for taking the time to test this issue.
I confirm that it works ok after using esc_url().
So it was not a major issue after all, lesson learned.
Note: See
TracTickets for help on using
tickets.
Hi there, welcome back to WordPress Trac! Thanks for the report.
I could not reproduce the issue on a clean install. This code:
Returns the correct result in the page source:
That said, the browser does indeed convert
¬
to the¬
character, also known as the "not sign" and represented as¬
or¬
or¬
.To avoid that, you should run the result throught the
esc_url()
function:That would escape the ampersand and would be correctly displayed in the browser: