(bug 36537) Rename calls to wfArrayToCGI to wfArrayToCgi
authorAlex Monk <krenair@gmail.com>
Mon, 28 Jan 2013 18:04:20 +0000 (18:04 +0000)
committerAlex Monk <krenair@gmail.com>
Mon, 28 Jan 2013 18:04:20 +0000 (18:04 +0000)
Done with this command:
grep wfArrayToCGI * -R -l -Z | xargs -0 -l sed -i -e 's/wfArrayToCGI/wfArrayToCgi/g' && git checkout -- HISTORY

Change-Id: If7f4d4bfc199289c11c43cf519c2415a1aad1c51

19 files changed:
api.php
includes/Action.php
includes/HttpFunctions.php
includes/OutputPage.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/SpecialPageFactory.php
includes/Title.php
includes/WebRequest.php
includes/actions/PurgeAction.php
includes/filerepo/FileRepo.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php
includes/media/ImageHandler.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/specials/SpecialContributions.php
includes/specials/SpecialNewpages.php
profileinfo.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php

diff --git a/api.php b/api.php
index 7fae373..94266d8 100644 (file)
--- a/api.php
+++ b/api.php
@@ -97,7 +97,7 @@ if ( $wgAPIRequestLog ) {
        if ( $module->mustBePosted() ) {
                $items[] = "action=" . $wgRequest->getVal( 'action' );
        } else {
-               $items[] = wfArrayToCGI( $wgRequest->getValues() );
+               $items[] = wfArrayToCgi( $wgRequest->getValues() );
        }
        wfErrorLog( implode( ',', $items ) . "\n", $wgAPIRequestLog );
        wfDebug( "Logged API request to $wgAPIRequestLog\n" );
index c54640f..0bc5ba2 100644 (file)
@@ -406,7 +406,7 @@ abstract class FormAction extends Action {
                        $this->getRequest()->getQueryValues(),
                        array( 'action' => null, 'title' => null )
                );
-               $form->addHiddenField( 'redirectparams', wfArrayToCGI( $params ) );
+               $form->addHiddenField( 'redirectparams', wfArrayToCgi( $params ) );
 
                $form->addPreText( $this->preText() );
                $form->addPostText( $this->postText() );
index b1092df..337beb4 100644 (file)
@@ -830,7 +830,7 @@ class PhpHttpRequest extends MWHttpRequest {
                parent::execute();
 
                if ( is_array( $this->postData ) ) {
-                       $this->postData = wfArrayToCGI( $this->postData );
+                       $this->postData = wfArrayToCgi( $this->postData );
                }
 
                if ( $this->parsedUrl['scheme'] != 'http' &&
index 9c628cb..968acf6 100644 (file)
@@ -2128,7 +2128,7 @@ class OutputPage extends ContextSource {
                                        unset( $returntoquery['title'] );
                                        unset( $returntoquery['returnto'] );
                                        unset( $returntoquery['returntoquery'] );
-                                       $query['returntoquery'] = wfArrayToCGI( $returntoquery );
+                                       $query['returntoquery'] = wfArrayToCgi( $returntoquery );
                                }
                        }
                        $loginLink = Linker::linkKnown(
index 1f86a0f..a673a65 100644 (file)
@@ -169,7 +169,7 @@ class SkinTemplate extends Skin {
                        unset( $query['returnto'] );
                        unset( $query['returntoquery'] );
                }
-               $this->thisquery = wfArrayToCGI( $query );
+               $this->thisquery = wfArrayToCgi( $query );
                $this->loggedin = $user->isLoggedIn();
                $this->username = $user->getName();
 
@@ -577,7 +577,7 @@ class SkinTemplate extends Skin {
                        $a['wpStickHTTPS'] = true;
                }
 
-               $returnto = wfArrayToCGI( $a );
+               $returnto = wfArrayToCgi( $a );
                if( $this->loggedin ) {
                        $personal_urls['userpage'] = array(
                                'text' => $this->username,
index ca94043..338b50d 100644 (file)
@@ -846,7 +846,7 @@ class SpecialPage {
 
                foreach ( $wgFeedClasses as $format => $class ) {
                        $theseParams = $params + array( 'feedformat' => $format );
-                       $url = $feedTemplate . wfArrayToCGI( $theseParams );
+                       $url = $feedTemplate . wfArrayToCgi( $theseParams );
                        $this->getOutput()->addFeedLink( $format, $url );
                }
        }
@@ -904,7 +904,7 @@ abstract class FormSpecialPage extends SpecialPage {
                // Retain query parameters (uselang etc)
                $params = array_diff_key(
                        $this->getRequest()->getQueryValues(), array( 'title' => null ) );
-               $form->addHiddenField( 'redirectparams', wfArrayToCGI( $params ) );
+               $form->addHiddenField( 'redirectparams', wfArrayToCgi( $params ) );
 
                $form->addPreText( $this->preText() );
                $form->addPostText( $this->postText() );
@@ -1045,7 +1045,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
                // Redirect to index.php with query parameters
                } elseif ( $redirect === true ) {
                        global $wgScript;
-                       $url = $wgScript . '?' . wfArrayToCGI( $query );
+                       $url = $wgScript . '?' . wfArrayToCgi( $query );
                        $this->getOutput()->redirect( $url );
                        return $redirect;
                } else {
index 5e5d1fc..fd5d52c 100644 (file)
@@ -476,7 +476,7 @@ class SpecialPageFactory {
                        if ( $name != $page->getLocalName() && !$context->getRequest()->wasPosted() ) {
                                $query = $context->getRequest()->getQueryValues();
                                unset( $query['title'] );
-                               $query = wfArrayToCGI( $query );
+                               $query = wfArrayToCgi( $query );
                                $title = $page->getTitle( $par );
                                $url = $title->getFullUrl( $query );
                                $context->getOutput()->redirect( $url );
index a3f17a7..4271555 100644 (file)
@@ -1330,7 +1330,7 @@ class Title {
         * second argument named variant. This was deprecated in favor
         * of passing an array of option with a "variant" key
         * Once $query2 is removed for good, this helper can be dropped
-        * andthe wfArrayToCGI moved to getLocalURL();
+        * andthe wfArrayToCgi moved to getLocalURL();
         *
         * @since 1.19 (r105919)
         * @param $query
@@ -1342,15 +1342,15 @@ class Title {
                        wfDeprecated( "Title::get{Canonical,Full,Link,Local} method called with a second parameter is deprecated. Add your parameter to an array passed as the first parameter.", "1.19" );
                }
                if ( is_array( $query ) ) {
-                       $query = wfArrayToCGI( $query );
+                       $query = wfArrayToCgi( $query );
                }
                if ( $query2 ) {
                        if ( is_string( $query2 ) ) {
                                // $query2 is a string, we will consider this to be
                                // a deprecated $variant argument and add it to the query
-                               $query2 = wfArrayToCGI( array( 'variant' => $query2 ) );
+                               $query2 = wfArrayToCgi( array( 'variant' => $query2 ) );
                        } else {
-                               $query2 = wfArrayToCGI( $query2 );
+                               $query2 = wfArrayToCgi( $query2 );
                        }
                        // If we have $query content add a & to it first
                        if ( $query ) {
index 827b20e..594226b 100644 (file)
@@ -720,7 +720,7 @@ class WebRequest {
                $newquery = $this->getQueryValues();
                unset( $newquery['title'] );
                $newquery = array_merge( $newquery, $array );
-               $query = wfArrayToCGI( $newquery );
+               $query = wfArrayToCgi( $newquery );
                return $onlyquery ? $query : $wgTitle->getLocalURL( $query );
        }
 
index cd58889..4c5171c 100644 (file)
@@ -62,7 +62,7 @@ class PurgeAction extends FormAction {
                $this->checkCanExecute( $this->getUser() );
 
                if ( $this->getUser()->isAllowed( 'purge' ) ) {
-                       $this->redirectParams = wfArrayToCGI( array_diff_key(
+                       $this->redirectParams = wfArrayToCgi( array_diff_key(
                                $this->getRequest()->getQueryValues(),
                                array( 'title' => null, 'action' => null )
                        ) );
index 82f7b49..4cc4fde 100644 (file)
@@ -694,7 +694,7 @@ class FileRepo {
        public function getDescriptionStylesheetUrl() {
                if ( isset( $this->scriptDirUrl ) ) {
                        return $this->makeUrl( 'title=MediaWiki:Filepage.css&' .
-                               wfArrayToCGI( Skin::getDynamicStylesheetQuery() ) );
+                               wfArrayToCgi( Skin::getDynamicStylesheetQuery() ) );
                }
                return false;
        }
index 4892770..b27f773 100644 (file)
@@ -426,7 +426,7 @@ class WebInstaller extends Installer {
                $url = preg_replace( '/\?.*$/', '', $url );
 
                if ( $query ) {
-                       $url .= '?' . wfArrayToCGI( $query );
+                       $url .= '?' . wfArrayToCgi( $query );
                }
 
                return $url;
index 52d493f..68e8e11 100644 (file)
@@ -1002,7 +1002,7 @@ class WebInstaller_Options extends WebInstallerPage {
                $styleUrl = $server . dirname( dirname( $this->parent->getUrl() ) ) .
                        '/skins/common/config-cc.css';
                $iframeUrl = 'http://creativecommons.org/license/?' .
-                       wfArrayToCGI( array(
+                       wfArrayToCgi( array(
                                'partner' => 'MediaWiki',
                                'exit_url' => $exitUrl,
                                'lang' => $this->getVar( '_UserLang' ),
index 6175907..d1de0ae 100644 (file)
@@ -188,7 +188,7 @@ abstract class ImageHandler extends MediaHandler {
                if ( !$this->normaliseParams( $image, $params ) ) {
                        return false;
                }
-               $url = $script . '&' . wfArrayToCGI( $this->getScriptParams( $params ) );
+               $url = $script . '&' . wfArrayToCgi( $this->getScriptParams( $params ) );
 
                if( $image->mustRender() || $params['width'] < $image->getWidth() ) {
                        return new ThumbnailImage( $image, $url, false, $params );
index 1d36911..32cf6b2 100644 (file)
@@ -224,7 +224,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                                "};\n";
 
                        // Conditional script injection
-                       $scriptTag = Html::linkedScript( $wgLoadScript . '?' . wfArrayToCGI( $query ) );
+                       $scriptTag = Html::linkedScript( $wgLoadScript . '?' . wfArrayToCgi( $query ) );
                        $out .= "if ( isCompatible() ) {\n" .
                                "\t" . Xml::encodeJsCall( 'document.write', array( $scriptTag ) ) .
                                "}\n" .
index f7e316b..54ec07d 100644 (file)
@@ -152,7 +152,7 @@ class SpecialContributions extends SpecialPage {
                                $apiParams['month'] = $this->opts['month'];
                        }
 
-                       $url = wfScript( 'api' ) . '?' . wfArrayToCGI( $apiParams );
+                       $url = wfScript( 'api' ) . '?' . wfArrayToCgi( $apiParams );
 
                        $out->redirect( $url, '301' );
                        return;
index 85b9cf8..d9d6a79 100644 (file)
@@ -146,7 +146,7 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                        $allValues = $this->opts->getAllValues();
                        unset( $allValues['feed'] );
-                       $out->setFeedAppendQuery( wfArrayToCGI( $allValues ) );
+                       $out->setFeedAppendQuery( wfArrayToCgi( $allValues ) );
                }
 
                $pager = new NewPagesPager( $this, $this->opts );
index 0e4131b..cbbf2ab 100644 (file)
@@ -349,7 +349,7 @@ function getEscapedProfileUrl( $_filter = false, $_sort = false, $_expand = fals
 
        return htmlspecialchars(
                '?' .
-               wfArrayToCGI( array(
+               wfArrayToCgi( array(
                        'filter' => $_filter ? $_filter : $filter,
                        'sort' => $_sort ? $_sort : $sort,
                        'expand' => implode( ',', array_keys( $_expand ) )
index 1a02cb8..47f9577 100644 (file)
@@ -132,14 +132,14 @@ class GlobalTest extends MediaWikiTestCase {
         * @dataProvider provideArrayToCGI
         */
        function testArrayToCGI( $array, $result ) {
-               $this->assertEquals( $result, wfArrayToCGI( $array ) );
+               $this->assertEquals( $result, wfArrayToCgi( $array ) );
        }
 
 
        function testArrayToCGI2() {
                $this->assertEquals(
                        "baz=bar&foo=bar",
-                       wfArrayToCGI(
+                       wfArrayToCgi(
                                array( 'baz' => 'bar' ),
                                array( 'foo' => 'bar', 'baz' => 'overridden value' ) ) );
        }
@@ -183,7 +183,7 @@ class GlobalTest extends MediaWikiTestCase {
         * @dataProvider provideCgiRoundTrip
         */
        function testCgiRoundTrip( $cgi ) {
-               $this->assertEquals( $cgi, wfArrayToCGI( wfCgiToArray( $cgi ) ) );
+               $this->assertEquals( $cgi, wfArrayToCgi( wfCgiToArray( $cgi ) ) );
        }
 
        function testMimeTypeMatch() {