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
Status: Closed Package: *Languages/Translation
PHP Version: 5.3.6 OS: Mac OS X 10.6.7
Private report: No CVE-ID:
 [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-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 14:02:33 2014 UTC