r60651 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60650‎ | r60651 | r60652 >
Date:09:34, 5 January 2010
Author:siebrand
Status:ok
Tags:
Comment:
Follow-up r60650: run stylize.php and remove trailing whitespace
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -173,7 +173,7 @@
174174 }
175175
176176 // get language variant preference from logged in users
177 - // Don't call this on stub objects because that causes infinite
 177+ // Don't call this on stub objects because that causes infinite
178178 // recursion during initialisation
179179 if ( $fromUser && $wgUser->isLoggedIn() ) {
180180 $this->mPreferredVariant = $wgUser->getOption( 'variant' );
@@ -197,7 +197,7 @@
198198 if ( $fromHeader && $acceptLanguage ) {
199199 // explode by comma
200200 $result = explode( ',', strtolower( $acceptLanguage ) );
201 -
 201+
202202 $languages = array();
203203
204204 foreach ( $result as $elem ) {
@@ -242,7 +242,7 @@
243243 }
244244 return $this->mMainLanguageCode;
245245 }
246 -
 246+
247247 /**
248248 * Caption convert, base on preg_replace_callback.
249249 *
@@ -318,11 +318,11 @@
319319
320320 $ret = $this->translate( $m[0], $toVariant );
321321 $mstart = $m[1] + strlen( $m[0] );
322 -
 322+
323323 // enable convertsion of '<img alt="xxxx" ... '
324324 // or '<span title="xxxx" ... '
325325 $captionpattern = '/\s(title|alt)\s*=\s*"([\s\S]*?)"/';
326 -
 326+
327327 $trtext = '';
328328 $trtextmark = "\0";
329329 $notrtext = array();
@@ -425,12 +425,12 @@
426426 $ret[$variant] .= $this->translate( $marked[1], $variant );
427427 }
428428 }
429 -
 429+
430430 }
431431
432432 return $ret;
433433 }
434 -
 434+
435435 /**
436436 * Prepare manual conversion table.
437437 * @private
@@ -491,7 +491,7 @@
492492
493493 return $text;
494494 }
495 -
 495+
496496 /**
497497 * Convert namespace.
498498 * @param string $title the title included namespace
@@ -517,7 +517,7 @@
518518 */
519519 function preConvertTitle( $text, $variant ) {
520520 $this->mTitleOriginal = $text;
521 -
 521+
522522 $text = $this->convertNamespace( $text, $variant );
523523 $this->mTitleDisplay = $this->convert( $text );
524524 }
@@ -647,7 +647,7 @@
648648 $ns = NS_MAIN;
649649
650650 if ( $disableLinkConversion ||
651 - ( !$ignoreOtherCond &&
 651+ ( !$ignoreOtherCond &&
652652 ( $isredir == 'no'
653653 || $action == 'edit'
654654 || $action == 'submit'
@@ -750,7 +750,7 @@
751751
752752 $this->postLoadTables();
753753 $this->mTables[self::CACHE_VERSION_KEY] = true;
754 -
 754+
755755 $wgMemc->set( $this->mCacheKey, $this->mTables, 43200 );
756756 wfProfileOut( __METHOD__ . '-recache' );
757757 }
@@ -851,7 +851,7 @@
852852 $ret = array();
853853 foreach ( $blocks as $block ) {
854854 $mappings = explode( $this->mMarkup['end'], $block, 2 );
855 - $stripped = str_replace( array( "'", '"', '*', '#' ), '',
 855+ $stripped = str_replace( array( "'", '"', '*', '#' ), '',
856856 $mappings[0] );
857857 $table = explode( ';', $stripped );
858858 foreach ( $table as $t ) {
@@ -930,7 +930,7 @@
931931 return true;
932932 }
933933
934 - /**
 934+ /**
935935 * Armour rendered math against conversion.
936936 * Wrap math into rawoutput -{R| math }- syntax.
937937 * @public
@@ -951,7 +951,7 @@
952952 */
953953 class ConverterRule {
954954 var $mText; // original text in -{text}-
955 - var $mConverter; // LanguageConverter object
 955+ var $mConverter; // LanguageConverter object
956956 var $mManualCodeError = '<strong class="error">code error!</strong>';
957957 var $mRuleDisplay = '';
958958 var $mRuleTitle = false;
@@ -966,7 +966,7 @@
967967 * Constructor
968968 *
969969 * @param string $text the text between -{ and }-
970 - * @param object $converter a LanguageConverter object
 970+ * @param object $converter a LanguageConverter object
971971 * @access public
972972 */
973973 function __construct( $text, $converter ) {
@@ -998,7 +998,7 @@
999999 }
10001000 return false;
10011001 }
1002 -
 1002+
10031003 /**
10041004 * Parse flags with syntax -{FLAG| ... }-
10051005 * @private
@@ -1075,7 +1075,7 @@
10761076 $this->mRules = $rules;
10771077 $this->mFlags = $flags;
10781078 }
1079 -
 1079+
10801080 /**
10811081 * Generate conversion table.
10821082 * @private
@@ -1175,7 +1175,7 @@
11761176
11771177 if ( count( $bidtable ) + count( $unidtable ) == 0 ) {
11781178 return $this->mRules;
1179 - } elseif ( $doConvert ) { // the text converted
 1179+ } elseif ( $doConvert ) { // the text converted
11801180 // display current variant in bidirectional array
11811181 $disp = $this->getTextInBidtable( $variant );
11821182 // or display current variant in fallbacks
@@ -1222,7 +1222,7 @@
12231223 fill in the missing variants, if any,
12241224 with fallbacks */
12251225 if ( !array_key_exists( $v, $bidtable ) ) {
1226 - $variantFallbacks =
 1226+ $variantFallbacks =
12271227 $this->mConverter->getVariantFallbacks( $v );
12281228 $vf = $this->getTextInBidtable( $variantFallbacks );
12291229 if ( $vf ) {
@@ -1232,11 +1232,11 @@
12331233
12341234 if ( array_key_exists( $v, $bidtable ) ) {
12351235 foreach ( $vmarked as $vo ) {
1236 - // use syntax: -{A|zh:WordZh;zh-tw:WordTw}-
1237 - // or -{H|zh:WordZh;zh-tw:WordTw}-
 1236+ // use syntax: -{A|zh:WordZh;zh-tw:WordTw}-
 1237+ // or -{H|zh:WordZh;zh-tw:WordTw}-
12381238 // or -{-|zh:WordZh;zh-tw:WordTw}-
12391239 // to introduce a custom mapping between
1240 - // words WordZh and WordTw in the whole text
 1240+ // words WordZh and WordTw in the whole text
12411241 if ( $manLevel[$v] == 'bidirectional' ) {
12421242 $this->mConvTable[$v][$bidtable[$vo]] = $bidtable[$v];
12431243 }
@@ -1271,7 +1271,7 @@
12721272
12731273 // convert to specified variant
12741274 // syntax: -{zh-hans;zh-hant[;...]|<text to convert>}-
1275 - if ( count( array_diff( $flags, $variants ) ) == 0
 1275+ if ( count( array_diff( $flags, $variants ) ) == 0
12761276 and count( $flags ) != 0 ) {
12771277 // check if current variant in flags
12781278 if ( in_array( $variant, $flags ) ) {
@@ -1297,7 +1297,7 @@
12981298 }
12991299
13001300 if ( !in_array( 'R', $flags ) || !in_array( 'N', $flags ) ) {
1301 - // decode => HTML entities modified by Sanitizer::removeHTMLtags
 1301+ // decode => HTML entities modified by Sanitizer::removeHTMLtags
13021302 $this->mRules = str_replace( '=&gt;', '=>', $this->mRules );
13031303
13041304 $this->parseRules();
@@ -1321,7 +1321,7 @@
13221322 $this->mRuleDisplay = $rules;
13231323 } elseif ( in_array( 'N', $flags ) ) {
13241324 // proces N flag: output current variant name
1325 - $this->mRuleDisplay =
 1325+ $this->mRuleDisplay =
13261326 $this->mConverter->mVariantNames[ trim( $rules ) ];
13271327 } elseif ( in_array( 'D', $flags ) ) {
13281328 // proces D flag: output rules description
@@ -1347,10 +1347,10 @@
13481348 if ( in_array( '+', $flags ) ) {
13491349 $this->mRulesAction = 'add';
13501350 }
1351 -
 1351+
13521352 $this->generateConvTable();
13531353 }
1354 -
 1354+
13551355 /**
13561356 * @public
13571357 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60650Coding Convention cleanup, removed extraneous references to $_SERVERmah09:07, 5 January 2010

Status & tagging log