From: Ryan Kaldari Date: Thu, 2 Sep 2010 18:05:58 +0000 (+0000) Subject: Adding helpful comments X-Git-Tag: 1.31.0-rc.0~35225 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=b40de88cf7b856eb2a709db68ae99d7a3e6cf1c5;p=lhc%2Fweb%2Fwiklou.git Adding helpful comments --- diff --git a/languages/Language.php b/languages/Language.php index 74cdb757b3..e1f6b00eae 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1600,18 +1600,24 @@ class Language { return strtr( $matches[0], $wikiUpperChars ); } + /** + * Make a string's first character uppercase + */ function ucfirst( $str ) { $o = ord( $str ); - if ( $o < 96 ) { + if ( $o < 96 ) { // if already uppercase... return $str; } elseif ( $o < 128 ) { - return ucfirst( $str ); + return ucfirst( $str ); // use PHP's ucfirst() } else { // fall back to more complex logic in case of multibyte strings - return $this->uc( $str, true ); + return self::uc( $str, true ); } } + /** + * Convert a string to uppercase + */ function uc( $str, $first = false ) { if ( function_exists( 'mb_strtoupper' ) ) { if ( $first ) {