From: Raimond Spekking Date: Thu, 11 Feb 2010 21:21:22 +0000 (+0000) Subject: Simplify a bit per Platonides CR http://www.mediawiki.org/wiki/Special:Code/MediaWiki... X-Git-Tag: 1.31.0-rc.0~37816 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=e6ad4da6f347afce53114a3540389573017d34e6;p=lhc%2Fweb%2Fwiklou.git Simplify a bit per Platonides CR mediawiki.org/wiki/Special:Code/MediaWiki/61661#c5509 --- diff --git a/languages/Language.php b/languages/Language.php index 21ad57a6fb..34978774fc 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2178,12 +2178,7 @@ class Language { # We chopped in the middle of a character; remove it $string = $m[1]; } - # Do not truncate if the ellipsis actually make the string longer. Bug 22181 - if ( strlen( $string ) + strlen( $ellipsis ) < strlen( $stringOriginal ) ) { - return $string . $ellipsis; - } else { - return $stringOriginal; - } + $string = $string . $ellipsis; } else { $string = substr( $string, $length ); @@ -2192,12 +2187,13 @@ class Language { # We chopped in the middle of a character; remove the whole thing $string = preg_replace( '/^[\x80-\xbf]+/', '', $string ); } - # Do not truncate if the ellipsis actually make the string longer. Bug 22181 - if ( strlen( $string ) + strlen( $ellipsis ) < strlen( $stringOriginal ) ) { - return $ellipsis . $string; - } else { - return $stringOriginal; - } + $string = $ellipsis . $string; + } + # Do not truncate if the ellipsis actually make the string longer. Bug 22181 + if ( strlen( $string ) < strlen( $stringOriginal ) ) { + return $string; + } else { + return $stringOriginal; } }