r72207 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72206‎ | r72207 | r72208 >
Date:18:05, 2 September 2010
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
Adding helpful comments
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -1600,18 +1600,24 @@
16011601 return strtr( $matches[0], $wikiUpperChars );
16021602 }
16031603
 1604+ /**
 1605+ * Make a string's first character uppercase
 1606+ */
16041607 function ucfirst( $str ) {
16051608 $o = ord( $str );
1606 - if ( $o < 96 ) {
 1609+ if ( $o < 96 ) { // if already uppercase...
16071610 return $str;
16081611 } elseif ( $o < 128 ) {
1609 - return ucfirst( $str );
 1612+ return ucfirst( $str ); // use PHP's ucfirst()
16101613 } else {
16111614 // fall back to more complex logic in case of multibyte strings
1612 - return $this->uc( $str, true );
 1615+ return self::uc( $str, true );
16131616 }
16141617 }
16151618
 1619+ /**
 1620+ * Convert a string to uppercase
 1621+ */
16161622 function uc( $str, $first = false ) {
16171623 if ( function_exists( 'mb_strtoupper' ) ) {
16181624 if ( $first ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r72232Followup r72207, uc isn't staticreedy21:38, 2 September 2010

Comments

#Comment by Kaldari (talk | contribs)   21:43, 8 September 2010

accidental reversion fixed in follow-up r72232.

Status & tagging log