#53293 closed defect (bug) (worksforme)
add_query_arg returning a bad character
| Reported by: | rafasashi | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 5.7.2 |
| Severity: | major | Keywords: | |
| Cc: | Focuses: |
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)
#1
follow-up:
↓ 2
@
5 years ago
- Component Charset → General
- Keywords close added
Version 0, edited 5 years ago by
(next)
#2
in reply to: ↑ 1
@
5 years ago
- Resolution → worksforme
- Status new → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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: