#2406 closed defect (bug) (invalid)
add_query_arg() does not return Strict XHTML links.
Reported by: | majelbstoat | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.1 |
Component: | Administration | Keywords: | add_query_arg ampersand xhtml strict bg|has-patch |
Focuses: | Cc: |
Description
add_query_arg() is a useful general purpose function that can be employed to extend a query string if it already exists. However, the appending of new variables is done with '&' rather than '&', which means that links returned are not XHTML Strict 1.0 or XHTML 1.1 compliant. This is not important for wp-admin pages, but causes problems on site pages. Parsing errors in Firefox and possible more browsers cause the site not to be visible, returning only an XML error. The following patch alters add_query_arg() to append using the correct '&' connector, which would greatly enhance its usability for plugins that wish to work with links.
Attachments (1)
Change History (11)
#1
@
19 years ago
An alternative solution would be to add a 'strict = false' final argument which would determine whether to output & or &. This might necessitate a refactoring of the argument handling code at the top.
#2
@
19 years ago
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
+1
XHTML validity is one of WordPress' big things. Don't have time to give this a thorough look now, but I'll return to it.
#3
@
19 years ago
Might break if we use it in HTTP, for example. I recommend adding a parameter which is on by default.
#8
@
19 years ago
No, that's not what I said. It will break if used in HTTP headers sent with a header()
call.
add & instead of &