r73142 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73141‎ | r73142 | r73143 >
Date:19:15, 16 September 2010
Author:awjrichards
Status:ok
Tags:
Comment:
Followup r73139, switched to using wfAppendQuery. Thanks for the tip, Catrope
Modified paths:
  • /trunk/extensions/VariablePage/VariablePage.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VariablePage/VariablePage.body.php
@@ -30,19 +30,7 @@
3131
3232 // determine the URL to which we will redirect the user
3333 $url = $this->determinePage( $wgVariablePagePossibilities );
34 -
35 - // check if we have a pre-existing query string in the URL, merge it with our previously generated query
36 - $url_parts = parse_url( $url );
37 - $url_query = parse_url( $url, PHP_URL_QUERY );
38 - if ( $url_query ) {
39 - foreach ( explode( "&", $url_query ) as $params ) {
40 - list( $key, $value ) = explode( "=", $params );
41 - $query_orig[ $key ] = $value;
42 - }
43 - $query = array_merge( $query, $query_orig );
44 - }
45 - $full_query = $wgRequest->appendQueryArray( $query, true );
46 - $wgOut->redirect( $url_parts[ 'scheme' ] . '://' . $url_parts[ 'host' ] . $url_parts[ 'path' ] . '?' . $full_query );
 34+ $wgOut->redirect( wfAppendQuery( $url, $query ));
4735 }
4836
4937 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73139Updated to preserve query string in configured URLsawjrichards18:36, 16 September 2010

Status & tagging log