php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54176 locale_compose accepts more than 3 extlang
Submitted: 2011-03-07 08:43 UTC Modified: 2017-09-12 14:07 UTC
Votes:2
Avg. Score:1.5 ± 0.5
Reproduced:0 of 2 (0.0%)
From: giorgio dot liscio at email dot it Assigned:
Status: Verified Package: intl (PECL)
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-03-07 08:43 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, just a "cosmetic problem"

probably are affected variants and privates too

bad result:

<?php
$arr = array(
    'language'=>'en' ,
    'script'  =>'Hans' ,
    'region'  =>'CN'
    'extlang' => array('a','b','c','d','e','f')
);
echo locale_compose( $arr );
?>

good result:

<?php
$arr = array(
    'language'=>'en' ,
    'script'  =>'Hans' ,
    'region'  =>'CN'
    'extlang0' => 'a',
    'extlang1' => 'b',
    'extlang2' => 'c',
    'extlang3' => 'd'
);
echo locale_compose( $arr );
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-12 14:07 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: I18N and L10N related +Package: intl
 [2017-09-12 14:07 UTC] cmb@php.net
See <https://3v4l.org/knFrX> (correct behavior) vs.
<https://3v4l.org/mKqT4> (erroneous behavior, since only up to
three extlangs are supposed to be supported).

Apparently, the max_value which is regarded for multiple numbered
keys [1] is ignored for the single array case[2].

[1] <https://github.com/php/php-src/blob/PHP-7.0.23/ext/intl/locale/locale_methods.c#L858-L866>
[2] <https://github.com/php/php-src/blob/PHP-7.0.23/ext/intl/locale/locale_methods.c#L837-L852>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 14:01:40 2019 UTC