Bug #32046
closedfunction t3lib_div::validPathStr fails on certain file names
100%
Description
File t3lib/class.t3lib_div.php Line 3952 (function validPathStr):
if (strpos($theFile, '//') === FALSE && strpos($theFile, '\\') === FALSE && !preg_match('#(?:^\.\.|/\.\./|[[:cntrl:]])#', $theFile)) { return TRUE; }
The [[:cntrl:]] part of the search pattern matches on certain German umlauts (Ü, ß). The result is that certain files won't be shown.
Problem exists also in 4.5(.6).
Files
Updated by Dmitry Dulepov almost 13 years ago
- Status changed from New to Accepted
- Assignee set to Dmitry Dulepov
It also fails on any cyrillic letters. Thus it is not possible to have UTF-8 file names from t3lib_div::getFileGetAbsFileName().
Updated by Helmut Hummel almost 13 years ago
Dmitry Dulepov wrote:
It also fails on any cyrillic letters. Thus it is not possible to have UTF-8 file names from t3lib_div::getFileGetAbsFileName().
What are the exact letter that match the query?
I tried this:
$theFile='asdasäöüÄÖÜßАБВГДЕЖЅЗИІКЛМНОПҀРСТѸФХѠЦЧШЩЪꙐЬѢꙖѤЮѦѪѨѬѮѰѲѴ'; var_dump(preg_match('#(?:^\.\.|/\.\./|[[:cntrl:]])#', $theFile));
But the result is "int 0"
Maybe it depends on the PHP version or if zend multibyte is used?
Maybe adding the "u" modifier already helps on your side?
$theFile='asdasäöüÄÖÜßАБВГДЕЖЅЗИІКЛМНОПҀРСТѸФХѠЦЧШЩЪꙐЬѢꙖѤЮѦѪѨѬѮѰѲѴ'; var_dump(preg_match('#(?:^\.\.|/\.\./|[[:cntrl:]])#u', $theFile));
Updated by Dmitry Dulepov almost 13 years ago
- File test-32046.php test-32046.php added
I attached a test file. Please, put it into the root of any TYPO3 installation and run. The result will be:
t3lib_div::validPathStr('fileadmin/templates/Ссылки (fce).xml') returns false
Expected result is:
t3lib_div::validPathStr('fileadmin/templates/Ссылки (fce).xml') returns true
Updated by Gerrit Code Review almost 13 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7032
Updated by Gerrit Code Review almost 13 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7032
Updated by Gerrit Code Review almost 13 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7032
Updated by Gerrit Code Review almost 13 years ago
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/7796
Updated by Gerrit Code Review almost 13 years ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/7797
Updated by Dmitry Dulepov almost 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset faf04f9d64058a21b219e688f105ca764552ca41.