php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54540 Allow loading of arbitrary resource bundles when fallback is disabled.
Submitted: 2011-04-15 14:38 UTC Modified: 2011-04-17 23:57 UTC
From: david dot zuelke at bitextender dot com Assigned: stas (profile)
Status: Closed Package: *Languages/Translation
PHP Version: 5.3.6 OS: Mac OS X 10.6.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david dot zuelke at bitextender dot com
New email:
PHP Version: OS:

 

 [2011-04-15 14:38 UTC] david dot zuelke at bitextender dot com
Description:
------------
ResourceBundle::__construct() uses ures_open(), which performs validity checks on 
the given locale identifier. That's reasonable, as the fallback functionality only 
works with proper locale IDs (example: you pass "de_DE", but no such bundle exist, 
it will then use the bundle "de" if that exists).

With the fallback flag off (third ctor argument), ures_open is still used. This 
won't allow loading of data in invalid identifiers, such as some of ICU's built-in 
data (e.g. "supplementalData").

Attached is a patch that uses ures_openDirect() if the fallback flag is off. Tests 
are also included.


Patches

resbundle_uresopen (last revision 2011-04-15 12:38 UTC by david dot zuelke at bitextender dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-15 14:40 UTC] johannes@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: stas
 [2011-04-15 14:40 UTC] johannes@php.net
Stas, please check this. Thanks!
 [2011-04-17 23:56 UTC] stas@php.net
Automatic comment from SVN on behalf of stas
Revision: http://svn.php.net/viewvc/?view=revision&revision=310293
Log: implement FR #54540 - Allow loading of arbitrary resource bundles when fallback is disabled
 [2011-04-17 23:57 UTC] stas@php.net
-Status: Assigned +Status: Closed
 [2011-04-17 23:57 UTC] stas@php.net
Applied, thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC