From c2c982c4e818057d749a344e0e94413b2f775ad0 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Mon, 28 Jan 2013 18:04:20 +0000 Subject: [PATCH] (bug 36537) Rename calls to wfArrayToCGI to wfArrayToCgi 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 --- api.php | 2 +- includes/Action.php | 2 +- includes/HttpFunctions.php | 2 +- includes/OutputPage.php | 2 +- includes/SkinTemplate.php | 4 ++-- includes/SpecialPage.php | 6 +++--- includes/SpecialPageFactory.php | 2 +- includes/Title.php | 8 ++++---- includes/WebRequest.php | 2 +- includes/actions/PurgeAction.php | 2 +- includes/filerepo/FileRepo.php | 2 +- includes/installer/WebInstaller.php | 2 +- includes/installer/WebInstallerPage.php | 2 +- includes/media/ImageHandler.php | 2 +- includes/resourceloader/ResourceLoaderStartUpModule.php | 2 +- includes/specials/SpecialContributions.php | 2 +- includes/specials/SpecialNewpages.php | 2 +- profileinfo.php | 2 +- tests/phpunit/includes/GlobalFunctions/GlobalTest.php | 6 +++--- 19 files changed, 27 insertions(+), 27 deletions(-) diff --git a/api.php b/api.php index 7fae373102..94266d88fb 100644 --- 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" ); diff --git a/includes/Action.php b/includes/Action.php index c54640fe25..0bc5ba2e67 100644 --- a/includes/Action.php +++ b/includes/Action.php @@ -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() ); diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index b1092df88f..337beb4435 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -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' && diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 9c628cb5eb..968acf6d41 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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( diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 1f86a0fada..a673a652c9 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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, diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index ca940437f3..338b50de4b 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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 { diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index 5e5d1fcc94..fd5d52ce89 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -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 ); diff --git a/includes/Title.php b/includes/Title.php index a3f17a7fea..42715552f3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ) { diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 827b20e80e..594226bb70 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -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 ); } diff --git a/includes/actions/PurgeAction.php b/includes/actions/PurgeAction.php index cd58889db1..4c5171c9d0 100644 --- a/includes/actions/PurgeAction.php +++ b/includes/actions/PurgeAction.php @@ -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 ) ) ); diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 82f7b490b5..4cc4fdec5c 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -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; } diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 48927705f0..b27f773cd0 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -426,7 +426,7 @@ class WebInstaller extends Installer { $url = preg_replace( '/\?.*$/', '', $url ); if ( $query ) { - $url .= '?' . wfArrayToCGI( $query ); + $url .= '?' . wfArrayToCgi( $query ); } return $url; diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 52d493ff0d..68e8e11109 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -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' ), diff --git a/includes/media/ImageHandler.php b/includes/media/ImageHandler.php index 61759074d8..d1de0ae847 100644 --- a/includes/media/ImageHandler.php +++ b/includes/media/ImageHandler.php @@ -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 ); diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 1d36911fba..32cf6b2673 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -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" . diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index f7e316b799..54ec07d01e 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -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; diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 85b9cf8c0c..d9d6a79608 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -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 ); diff --git a/profileinfo.php b/profileinfo.php index 0e4131b147..cbbf2abdaf 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -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 ) ) diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 1a02cb82bb..47f95772e0 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -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() { -- 2.20.1