php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74385 Locale::parseLocale() broken with some arguments
Submitted: 2017-04-06 14:21 UTC Modified: -
From: cz dot paranoiq at gmail dot com Assigned:
Status: Closed Package: intl (PECL)
PHP Version: 7.1.3 OS:
Private report: No CVE-ID: None
 [2017-04-06 14:21 UTC] cz dot paranoiq at gmail dot com
Description:
------------
Locale::parseLocale (and locale_parse) is not able to parse locale with advanced agruments since PHP 5.6.28, 7.0.14 and 7.1.x (see https://3v4l.org/rRZK6)

Test script:
---------------
<?php

var_dump(Locale::parseLocale('cs_cz'));

var_dump(Locale::parseLocale('cs_Latn_CZ_VAR1_VAR2_X_PRI1_PRI2@calendar=iso8601;colbackwards=yes;colcasefirst=lower;collation=phonebook;currency=CZK;numbers=arab'));

Expected result:
----------------
array(2) {
  ["language"]=> string(2) "cs"
  ["region"]=> string(2) "CZ"
}
array(7) {
  ["language"]=> string(2) "cs"
  ["script"]=> string(4) "Latn"
  ["region"]=> string(2) "CZ"
  ["variant0"]=> string(4) "VAR1"
  ["variant1"]=> string(4) "VAR2"
  ["private0"]=> string(4) "PRI1"
  ["private1"]=> string(103) "PRI2@calendar=iso8601;colbackwards=yes;colcasefirst=lower;collation=phonebook;currency=CZK;numbers=arab"
}

Actual result:
--------------
array(2) {
  ["language"]=> string(2) "cs"
  ["region"]=> string(2) "CZ"
}
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-03 14:45 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f59b201f199155a944a9411cc474a593d0f481a2
Log: Fixed bug #74385 Locale::parseLocale() broken with some arguments
 [2018-05-03 14:45 UTC] ab@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Dec 16 13:01:25 2018 UTC