Opened 13 months ago
Last modified 12 months ago
#4508 new Defect
cache_handler does not support hyphens
| Reported by: | mikehedman | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Near Term Future Release |
| Component: | Core | Version: | 1.8.4 |
| Severity: | minor | Keywords: | cache |
| Cc: | brett@… | Difficulty: |
Description
In elgg.reload_all_translations, an ajax call is made to a url like:
cache/js/default/languages/en-gb.1234545.js
The problem is that when using a hyphenated language identifier (en-gb), the cache handler code rejects the request through the following filter:
only alphanumeric characters plus /, ., and _ and no '..'
$filter = array("options" => array("regexp" => "/(\.?[_a-zA-Z0-9\/]+)+$/"));
Adding "\-" to the front of the filter fixes it:
$filter = array("options" => array("regexp" => "/(\.?[\-_a-zA-Z0-9\/]+)+$/"));
As an aside... when this filter rejects the request, it echos back a message. But since this is being called through ajax, loading the JavaScript file fails silently...and then mysterious things start NOT working on your site.
Change History (1)
comment:1 Changed 12 months ago by ewinslow
- Milestone changed from Needs Review to Near Term Future Release
