r81813 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81812‎ | r81813 | r81814 >
Date:14:54, 9 February 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Quick fix for using $wgTitle where it should not
Modified paths:
  • /trunk/extensions/LanguageSelector/LanguageSelector.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LanguageSelector/LanguageSelector.php
@@ -152,7 +152,7 @@
153153 global $wgExtensionAssetsPath, $wgLanguageSelectorLocation, $wgLanguageSelectorFormUsed;
154154
155155 if ( $wgLanguageSelectorLocation == LANGUAGE_SELECTOR_AT_TOP_OF_TEXT ) {
156 - $html = wfLanguageSelectorHTML();
 156+ $html = wfLanguageSelectorHTML( $out->getTitle() );
157157 $out->mBodytext = $html . $out->mBodytext;
158158 }
159159
@@ -171,8 +171,8 @@
172172 return true;
173173 }
174174
175 -function wfLanguageSelectorSkinHook( &$out ) {
176 - $html = wfLanguageSelectorHTML();
 175+function wfLanguageSelectorSkinHook( &$skin ) {
 176+ $html = wfLanguageSelectorHTML( $skin->mTitle );
177177 print $html;
178178 return true;
179179 }
@@ -213,7 +213,7 @@
214214 # So that this also works with parser cache
215215 $parser->getOutput()->addOutputHook( 'languageselector' );
216216
217 - return wfLanguageSelectorHTML( $style, $class, $selectorstyle, $buttonstyle, $showcode );
 217+ return wfLanguageSelectorHTML( $parser->getTitle(), $style, $class, $selectorstyle, $buttonstyle, $showcode );
218218 }
219219
220220 function wfLanguageSelectorSkinTemplateOutputPageBeforeExec( &$skin, &$tpl ) {
@@ -247,7 +247,7 @@
248248 }
249249
250250 if ($key) {
251 - $html = wfLanguageSelectorHTML();
 251+ $html = wfLanguageSelectorHTML( $wgTitle );
252252 $tpl->set( $key, $tpl->data[ $key ] . $html );
253253 }
254254
@@ -344,8 +344,8 @@
345345 $wgLanguageSelectorFormUsed = true;
346346 }
347347
348 -function wfLanguageSelectorHTML( $style = null, $class = null, $selectorstyle = null, $buttonstyle = null, $showCode = null ) {
349 - global $wgLanguageSelectorLanguages, $wgTitle, $wgLang, $wgContLang, $wgScript,
 348+function wfLanguageSelectorHTML( Title $title, $style = null, $class = null, $selectorstyle = null, $buttonstyle = null, $showCode = null ) {
 349+ global $wgLanguageSelectorLanguages, $wgLang, $wgContLang, $wgScript,
350350 $wgLanguageSelectorShowCode, $wgLanguageSelectorFormUsed;
351351
352352 if ( $showCode === null ) {
@@ -371,7 +371,7 @@
372372 'action' => $wgScript,
373373 'style' => 'display:inline;'
374374 ) );
375 - $html .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() );
 375+ $html .= Xml::hidden( 'title', $title->getPrefixedDBKey() );
376376 $html .= Xml::openElement('select', array(
377377 'name' => 'setlang',
378378 'id' => 'languageselector-select-' . $id,

Status & tagging log