Index: trunk/phase3/languages/Language.php |
— | — | @@ -1600,18 +1600,24 @@ |
1601 | 1601 | return strtr( $matches[0], $wikiUpperChars ); |
1602 | 1602 | } |
1603 | 1603 | |
| 1604 | + /** |
| 1605 | + * Make a string's first character uppercase |
| 1606 | + */ |
1604 | 1607 | function ucfirst( $str ) { |
1605 | 1608 | $o = ord( $str ); |
1606 | | - if ( $o < 96 ) { |
| 1609 | + if ( $o < 96 ) { // if already uppercase... |
1607 | 1610 | return $str; |
1608 | 1611 | } elseif ( $o < 128 ) { |
1609 | | - return ucfirst( $str ); |
| 1612 | + return ucfirst( $str ); // use PHP's ucfirst() |
1610 | 1613 | } else { |
1611 | 1614 | // fall back to more complex logic in case of multibyte strings |
1612 | | - return $this->uc( $str, true ); |
| 1615 | + return self::uc( $str, true ); |
1613 | 1616 | } |
1614 | 1617 | } |
1615 | 1618 | |
| 1619 | + /** |
| 1620 | + * Convert a string to uppercase |
| 1621 | + */ |
1616 | 1622 | function uc( $str, $first = false ) { |
1617 | 1623 | if ( function_exists( 'mb_strtoupper' ) ) { |
1618 | 1624 | if ( $first ) { |