add_query_arg() should encode values
|Reported by:||Viper007Bond||Owned by:|
|Cc:||kpayne@…, justin@…, phill@…, deanmarktaylor@…|
One (or me at least) would expect that the result of
add_query_arg( 'foobar', 'this&that', 'index.php' )
since the whole purpose of the function is to build a URL. However the actual result is
You're asking to the function to create a URL in which foobar is this&that but instead it creates a URL in which foobar is set to only this. You shouldn't have to pre-encode values -- the function should take care of it for you.
The function to "blame" for this is our build_query() which for some reason does not encode by default.
Change History (28)
comment:1 Viper007Bond — 2 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Version set to 3.2