Array query args on a paginated archive page creates PHP Warning, breaks page.
|Reported by:||ericlewis||Owned by:||nacin|
Having query args that are elements of an array breaks in redirect_canonical.
- Create enough posts in an install to warrant pagination of posts
- Go to second page and add an array element query arg eg. http://www.siteurl.com/page/2/?foo[bar]=true
I'm getting this PHP warning:
Warning: rawurlencode() expects parameter 1 to be string, array given in /Users/ericlewis/Sites/wp-trunk/wp-includes/canonical.php on line 283 Warning: Cannot modify header information - headers already sent by (output started at /Users/ericlewis/Sites/wp-trunk/wp-includes/canonical.php:283) in /Users/ericlewis/Sites/wp-trunk/wp-includes/pluggable.php on line 864
This stems from the fact that in redirect_canonical, the query args are parsed into an array via parse_str(), and then rawurlencode() is applied to each element of that array. In this case, that means rawurlencode is applied to an array (foo), which causes the issue.
Change History (10)
- Component changed from General to Canonical
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.4