X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=320cdf2622c16fb231fac741528bc7d1f63c957a;hb=5691476a3d87f7368fc09cc967a981cf29b863ad;hp=6fd5e1b95196e159ee45f69252218bb48cd7e87c;hpb=bc4c78889f9544e81bef8f88d09149a3d6d8a90c;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 6fd5e1b951..320cdf2622 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2706,6 +2706,7 @@ class Language { * * @param $opposite Boolean Get the direction mark opposite to your language * @return string + * @since 1.20 */ function getDirMarkEntity( $opposite = false ) { if ( $opposite ) { return $this->isRTL() ? '‎' : '‏'; } @@ -2996,6 +2997,7 @@ class Language { * Take a list of strings and build a locale-friendly comma-separated * list, using the local comma-separator message. * The last two strings are chained with an "and". + * NOTE: This function will only work with standard numeric array keys (0, 1, 2…) * * @param $l Array * @return string @@ -3003,7 +3005,10 @@ class Language { function listToText( array $l ) { $s = ''; $m = count( $l ) - 1; - if ( $m == 1 ) { + + if ( $m === 0 ) { + return $l[0]; + } elseif ( $m === 1 ) { return $l[0] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $l[1]; } else { for ( $i = $m; $i >= 0; $i-- ) {