r99075 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99074‎ | r99075 | r99076 >
Date:02:34, 6 October 2011
Author:tstarling
Status:ok
Tags:
Comment:
MFT r99074 (LanguageTr::uc() breakage)
Modified paths:
  • /branches/wmf/1.18wmf1/languages/classes (modified) (history)
  • /branches/wmf/1.18wmf1/languages/classes/LanguageTr.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/languages/classes/LanguageTr.php
@@ -17,7 +17,7 @@
1818 * @return string
1919 */
2020 function ucfirst ( $string ) {
21 - if ( !empty( $string ) && $string[0] == 'i' ) {
 21+ if ( strlen( $string ) && $string[0] == 'i' ) {
2222 return 'İ' . substr( $string, 1 );
2323 } else {
2424 return parent::ucfirst( $string );
@@ -29,7 +29,7 @@
3030 * @return mixed|string
3131 */
3232 function lcfirst ( $string ) {
33 - if ( !empty( $string ) && $string[0] == 'I' ) {
 33+ if ( strlen( $string ) && $string[0] == 'I' ) {
3434 return 'ı' . substr( $string, 1 );
3535 } else {
3636 return parent::lcfirst( $string );
@@ -45,7 +45,15 @@
4646 * @return string
4747 */
4848 function uc( $string, $first = false ) {
49 - $string = preg_replace( '/i/', 'İ', $string );
 49+ if ( strlen( $string ) ) {
 50+ if ( $first ) {
 51+ if ( $string[0] === 'i' ) {
 52+ $string = 'İ' . substr( $string, 1 );
 53+ }
 54+ } else {
 55+ $string = str_replace( 'i', 'İ', $string );
 56+ }
 57+ }
5058 return parent::uc( $string, $first );
5159 }
5260
@@ -58,7 +66,15 @@
5967 * @return string
6068 */
6169 function lc( $string, $first = false ) {
62 - $string = preg_replace( '/I/', 'ı', $string );
 70+ if ( strlen( $string ) ) {
 71+ if ( $first ) {
 72+ if ( $string[0] == 'I' ) {
 73+ $string = 'ı' . substr( $string, 1 );
 74+ }
 75+ } else {
 76+ $string = str_replace( 'I', 'ı', $string );
 77+ }
 78+ }
6379 return parent::lc( $string, $first );
6480 }
6581
Property changes on: branches/wmf/1.18wmf1/languages/classes
___________________________________________________________________
Added: svn:mergeinfo
6682 Merged /branches/REL1_15/phase3/languages/classes:r51646
6783 Merged /branches/REL1_17/phase3/languages/classes:r81445,81448
6884 Merged /branches/nikola/phase3/languages/classes:r85224,85239,85308
6985 Merged /branches/sqlite/languages/classes:r58211-58321
7086 Merged /trunk/phase3/languages/classes:r92580,92713,92765,92884,92886-92887,92894,92898,92907,92932,93149,93151,93233-93234,93258,93266,93516-93518,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94346,94372,94422,94425,94444,94448,94456,94498,94601,94630,94728,94825,94862,94995-94997,95042,95155,95332,95410,95442,95468,95601,95812,99074
7187 Merged /branches/new-installer/phase3/languages/classes:r43664-66004

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99074Fixes for r84057 LanguageTr uc/lc:...tstarling02:31, 6 October 2011

Status & tagging log