r69887 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69886‎ | r69887 | r69888 >
Date:18:13, 25 July 2010
Author:reedy
Status:ok
Tags:
Comment:
More self:: to $this->
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk_cyrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadBase.php
@@ -362,7 +362,7 @@
363363 return array( 'uploadscripted' );
364364 }
365365 if( $this->mFinalExtension == 'svg' || $mime == 'image/svg+xml' ) {
366 - if( self::detectScriptInSvg( $this->mTempPath ) ) {
 366+ if( $this->detectScriptInSvg( $this->mTempPath ) ) {
367367 return array( 'uploadscripted' );
368368 }
369369 }
Index: trunk/phase3/includes/parser/Parser.php
@@ -212,7 +212,7 @@
213213 */
214214 # $this->mUniqPrefix = "\x07UNIQ" . Parser::getRandomString();
215215 # Changed to \x7f to allow XML double-parsing -- TS
216 - $this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString();
 216+ $this->mUniqPrefix = "\x7fUNIQ" . $this->getRandomString();
217217
218218
219219 # Clear these on every parse, bug 4549
Index: trunk/phase3/languages/Language.php
@@ -1597,23 +1597,23 @@
15981598 return ucfirst( $str );
15991599 } else {
16001600 // fall back to more complex logic in case of multibyte strings
1601 - return self::uc( $str, true );
 1601+ return $this->uc( $str, true );
16021602 }
16031603 }
16041604
16051605 function uc( $str, $first = false ) {
16061606 if ( function_exists( 'mb_strtoupper' ) ) {
16071607 if ( $first ) {
1608 - if ( self::isMultibyte( $str ) ) {
 1608+ if ( $this->isMultibyte( $str ) ) {
16091609 return mb_strtoupper( mb_substr( $str, 0, 1 ) ) . mb_substr( $str, 1 );
16101610 } else {
16111611 return ucfirst( $str );
16121612 }
16131613 } else {
1614 - return self::isMultibyte( $str ) ? mb_strtoupper( $str ) : strtoupper( $str );
 1614+ return $this->isMultibyte( $str ) ? mb_strtoupper( $str ) : strtoupper( $str );
16151615 }
16161616 } else {
1617 - if ( self::isMultibyte( $str ) ) {
 1617+ if ( $this->isMultibyte( $str ) ) {
16181618 list( $wikiUpperChars ) = $this->getCaseMaps();
16191619 $x = $first ? '^' : '';
16201620 return preg_replace_callback(
@@ -1632,7 +1632,7 @@
16331633 if ( !$o ) {
16341634 return strval( $str );
16351635 } elseif ( $o >= 128 ) {
1636 - return self::lc( $str, true );
 1636+ return $this->lc( $str, true );
16371637 } elseif ( $o > 96 ) {
16381638 return $str;
16391639 } else {
@@ -1644,16 +1644,16 @@
16451645 function lc( $str, $first = false ) {
16461646 if ( function_exists( 'mb_strtolower' ) ) {
16471647 if ( $first ) {
1648 - if ( self::isMultibyte( $str ) ) {
 1648+ if ( $this->isMultibyte( $str ) ) {
16491649 return mb_strtolower( mb_substr( $str, 0, 1 ) ) . mb_substr( $str, 1 );
16501650 } else {
16511651 return strtolower( substr( $str, 0, 1 ) ) . substr( $str, 1 );
16521652 }
16531653 } else {
1654 - return self::isMultibyte( $str ) ? mb_strtolower( $str ) : strtolower( $str );
 1654+ return $this->isMultibyte( $str ) ? mb_strtolower( $str ) : strtolower( $str );
16551655 }
16561656 } else {
1657 - if ( self::isMultibyte( $str ) ) {
 1657+ if ( $this->isMultibyte( $str ) ) {
16581658 list( , $wikiLowerChars ) = self::getCaseMaps();
16591659 $x = $first ? '^' : '';
16601660 return preg_replace_callback(
@@ -1672,8 +1672,8 @@
16731673 }
16741674
16751675 function ucwords( $str ) {
1676 - if ( self::isMultibyte( $str ) ) {
1677 - $str = self::lc( $str );
 1676+ if ( $this->isMultibyte( $str ) ) {
 1677+ $str = $this->lc( $str );
16781678
16791679 // regexp to find first letter in each word (i.e. after each space)
16801680 $replaceRegexp = "/^([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)| ([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)/";
@@ -1699,8 +1699,8 @@
17001700
17011701 # capitalize words at word breaks
17021702 function ucwordbreaks( $str ) {
1703 - if ( self::isMultibyte( $str ) ) {
1704 - $str = self::lc( $str );
 1703+ if ( $this->isMultibyte( $str ) ) {
 1704+ $str = $this->lc( $str );
17051705
17061706 // since \b doesn't work for UTF-8, we explicitely define word break chars
17071707 $breaks = "[ \-\(\)\}\{\.,\?!]";
Index: trunk/phase3/languages/classes/LanguageKk_cyrl.php
@@ -257,7 +257,7 @@
258258 $secondPerson = array( "z" ); // 1st plural, 2nd formal
259259 $thirdPerson = array( "ı", "i" ); // 3rd
260260
261 - $lastLetter = self::lastLetter( $word, $allVowels );
 261+ $lastLetter = $this->lastLetter( $word, $allVowels );
262262 $wordEnding =& $lastLetter[0];
263263 $wordLastVowel =& $lastLetter[1];
264264

Status & tagging log