Bug #5246
closed
This is due to the processing done on filenames to clean them of possible invalid characters. This is done as follows.
preg_replace( '/[^-a-zA-Z0-9_]/', '', pathinfo( $value['name'], PATHINFO_FILENAME ) )
The problem is this won't work with UTF8 characters. The only way to force it to work is to use the u modifier and replace a-zA-Z0-9 with \w. The problem with that is the u modifier is extremely strict. Any partial UTF8 characters will cause it to silently fail. PCRE also needs to be compiled with UTF8 support or it throws a warning. Doesn't seam like a safe solution.
- Status changed from Assigned to Feedback
- Assignee changed from krileon to beat
Joomla also doesn't appear to account for utf8 in its preg_replace usages as well. Especially filenames. This seams like a "do not fix" type bug. It's also possible UTF8 characters in a filename could be an issue depending on the OS of the server.
Another option is a helper function that calls mb_ereg_replace when available otherwise call preg_replace then this would work. Similar to our other helper functions (e.g. cbutf8_preg_replace). This isn't a 1:1 solution though as mb_ereg_replace doesn't use delimiters so a helper function to call either/or probably wouldn't work very well.
- Status changed from Feedback to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF