r48491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48490‎ | r48491 | r48492 >
Date:16:30, 17 March 2009
Author:ialex
Status:ok
Tags:
Comment:
* Avoid E_DEPRECATED saying that split() is obsolete since PHP 5.3
* Fix error: define $contLang before using it :)
Modified paths:
  • /trunk/extensions/LanguageSelector/LanguageSelector.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LanguageSelector/LanguageSelector.php
@@ -261,13 +261,13 @@
262262
263263 function wfLanguageSelectorDetectLanguage( $mode ) {
264264 global $wgContLang, $wgLanguageSelectorLanguages;
265 -
 265+
 266+ $contLang = $wgContLang->getCode();
 267+
266268 if ( !$mode || $mode == LANGUAGE_SELECTOR_USE_CONTENT_LANG ) {
267269 return $contLang;
268270 }
269271
270 - $contLang = $wgContLang->getCode();
271 -
272272 /**
273273 * get accepted languages from Accept-Languages
274274 * HTTP header.
@@ -277,7 +277,7 @@
278278 if ( empty( $accept ) )
279279 return $contLang;
280280
281 - $accept = split( ',', $accept );
 281+ $accept = explode( ',', $accept );
282282
283283 /**
284284 * normalize accepted languages

Status & tagging log