Use WebRequest::getQueryValues() to get all query strings parameters instead of ...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 26 May 2011 16:18:35 +0000 (16:18 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 26 May 2011 16:18:35 +0000 (16:18 +0000)
includes/LogEventsList.php
includes/Pager.php
includes/SpecialPageFactory.php

index 87ad6ee..3d24d4c 100644 (file)
@@ -185,8 +185,10 @@ class LogEventsList {
        }
 
        private function getDefaultQuery() {
+               global $wgRequest;
+
                if ( !isset( $this->mDefaultQuery ) ) {
-                       $this->mDefaultQuery = $_GET;
+                       $this->mDefaultQuery = $wgRequest->getQueryValues();
                        unset( $this->mDefaultQuery['title'] );
                        unset( $this->mDefaultQuery['dir'] );
                        unset( $this->mDefaultQuery['offset'] );
index 8eb6c7c..fb657f8 100644 (file)
@@ -415,8 +415,10 @@ abstract class IndexPager implements Pager {
         * @return Associative array
         */
        function getDefaultQuery() {
+               global $wgRequest;
+
                if ( !isset( $this->mDefaultQuery ) ) {
-                       $this->mDefaultQuery = $_GET;
+                       $this->mDefaultQuery = $wgRequest->getQueryValues();
                        unset( $this->mDefaultQuery['title'] );
                        unset( $this->mDefaultQuery['dir'] );
                        unset( $this->mDefaultQuery['offset'] );
@@ -1025,14 +1027,16 @@ abstract class TablePager extends IndexPager {
 
        /**
         * Get <input type="hidden"> elements for use in a method="get" form.
-        * Resubmits all defined elements of the $_GET array, except for a
+        * Resubmits all defined elements of the query string, except for a
         * blacklist, passed in the $blacklist parameter.
         *
         * @return String: HTML fragment
         */
        function getHiddenFields( $blacklist = array() ) {
+               global $wgRequest;
+
                $blacklist = (array)$blacklist;
-               $query = $_GET;
+               $query = $wgRequest->getQueryValues();
                foreach ( $blacklist as $name ) {
                        unset( $query[$name] );
                }
index c8113a6..ea0048c 100644 (file)
@@ -435,7 +435,7 @@ class SpecialPageFactory {
                        // generate self-links without being aware that their default name has
                        // changed.
                        if ( $name != $page->getLocalName() && !$context->request->wasPosted() ) {
-                               $query = $_GET;
+                               $query = $context->request->getQueryValues();
                                unset( $query['title'] );
                                $query = wfArrayToCGI( $query );
                                $title = $page->getTitle( $par );