I some situations, especially related to forms constructed in wikitext, or in strict XHTML markup, it is necessary to use escaped ampersands or semicolons to delimit query string parameters. (See http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.2 for more info on this.) Currently the Wikimedia servers only accept non-escaped ampersands as delimiters for query string parameters.
Two possible solutions to this are:
- In our php.ini files, set arg_separator.input = ";&". This will allow people to use either ampersands or semicolons as delimiters for query string parameters (as recommended by the w3c).
- Replace line 50 of WebRequest.php with:
$requestPairs = $_POST + $_GET;
// Accomodate escaped ampersands as query string delimiters
foreach ( $requestPairs as $key => $val) {
if ( strncmp( $key, 'amp;', 4 ) === 0 ) {
$goodKey = substr( $key, 4 );
} else {
$goodKey = $key;
}
$this->data[$goodKey] = $val;
}
This will allow use of query string parameters separated by escaped ampersands.
The impetus for this bug is a problem in the DonationInterface extension related to forms that live in wikitext (thus forcing ampersands to be escaped). There are several workarounds available, but I thought I would propose a deeper solution to see what people thought.
Version: unspecified
Severity: enhancement