r88896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88895‎ | r88896 | r88897 >
Date:16:18, 26 May 2011
Author:ialex
Status:ok
Tags:
Comment:
Use WebRequest::getQueryValues() to get all query strings parameters instead of $_GET
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Pager.php
@@ -415,8 +415,10 @@
416416 * @return Associative array
417417 */
418418 function getDefaultQuery() {
 419+ global $wgRequest;
 420+
419421 if ( !isset( $this->mDefaultQuery ) ) {
420 - $this->mDefaultQuery = $_GET;
 422+ $this->mDefaultQuery = $wgRequest->getQueryValues();
421423 unset( $this->mDefaultQuery['title'] );
422424 unset( $this->mDefaultQuery['dir'] );
423425 unset( $this->mDefaultQuery['offset'] );
@@ -1025,14 +1027,16 @@
10261028
10271029 /**
10281030 * Get <input type="hidden"> elements for use in a method="get" form.
1029 - * Resubmits all defined elements of the $_GET array, except for a
 1031+ * Resubmits all defined elements of the query string, except for a
10301032 * blacklist, passed in the $blacklist parameter.
10311033 *
10321034 * @return String: HTML fragment
10331035 */
10341036 function getHiddenFields( $blacklist = array() ) {
 1037+ global $wgRequest;
 1038+
10351039 $blacklist = (array)$blacklist;
1036 - $query = $_GET;
 1040+ $query = $wgRequest->getQueryValues();
10371041 foreach ( $blacklist as $name ) {
10381042 unset( $query[$name] );
10391043 }
Index: trunk/phase3/includes/SpecialPageFactory.php
@@ -435,7 +435,7 @@
436436 // generate self-links without being aware that their default name has
437437 // changed.
438438 if ( $name != $page->getLocalName() && !$context->request->wasPosted() ) {
439 - $query = $_GET;
 439+ $query = $context->request->getQueryValues();
440440 unset( $query['title'] );
441441 $query = wfArrayToCGI( $query );
442442 $title = $page->getTitle( $par );
Index: trunk/phase3/includes/LogEventsList.php
@@ -185,8 +185,10 @@
186186 }
187187
188188 private function getDefaultQuery() {
 189+ global $wgRequest;
 190+
189191 if ( !isset( $this->mDefaultQuery ) ) {
190 - $this->mDefaultQuery = $_GET;
 192+ $this->mDefaultQuery = $wgRequest->getQueryValues();
191193 unset( $this->mDefaultQuery['title'] );
192194 unset( $this->mDefaultQuery['dir'] );
193195 unset( $this->mDefaultQuery['offset'] );

Status & tagging log