# [PATCH] Allow loading of arbitrary resource bundles when fallback is disabled.

- Thread: https://externals.io/message/51911
- Original archive: https://news-web.php.net/php.internals/51911
- Started by david.zuelke@bitextender.com on 2011-04-15T12:39:37+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #51911 — david.zuelke@bitextender.com — 2011-04-15T12:39:37+00:00

URL: https://externals.io/message/51911#51911

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").

http://bugs.php.net/bug.php?id=54540 has a patch, but I wanted to run it by Hans-Peter and Stas again in case they want to discuss this.

David

---

## #51923 — Stas Malyshev — 2011-04-17T22:19:27+00:00

URL: https://externals.io/message/51911#51923 · In reply to: #51911

Hi!

> 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").

I think it makes sense, I've applied it.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
