Bug #37701
closedt3lib_div::getAllFilesAndFoldersInPath no md5 for folders
100%
Description
if ($regDirs) { $fileArr[] = $path; }
should be
if ($regDirs) { $fileArr[md5($path)] = $path; }
analog to t3lib_div::getFilesInDir
related to: 6.0, 4.7, 4.6, 4.5 and earlier
Updated by Jigal van Hemert over 12 years ago
- Status changed from New to Needs Feedback
- % Done changed from 50 to 0
- Complexity deleted (
no-brainer)
Are you sure that it
1. is necessary (is something broken?)
2. doesn't break anything (t3lib_div::getFilesInDire() mentions that the md5-hash-keys must never be changed because import/export depends on them; will anything depend on numerical keys for directories?)
Updated by Kay Strobach over 12 years ago
hi,
as i read the function description everything should have a md5 hash (every path).
I use that functionality for a secure download extension (EXT:folder) (it depends on correct md5 hashes). The numbered keys for directories are simply inconsistent.
If somebody used something like:
intval($key) == $key
to decide wether an item is a file or not (haha), this may break this check, if not everything should be fine ;)
Updated by Kay Strobach over 12 years ago
i forgot to mention, that i have a small function, that fixes this bug for me - but i wanted to report it, to get it solved for everybody ;)
Updated by Jigal van Hemert over 12 years ago
- Status changed from Needs Feedback to Accepted
- TYPO3 Version changed from 4.5 to 6.0
- Complexity set to easy
I did a search for usages of getAllFilesAndFoldersInPath() in the core and nowhere the key is actually used.
I guess we can implement it as a feature (with some documentation perhaps about possible breaking things?)
By the way, it may come as a surprise to you but
intval($key) == $key
will be TRUE for any number or string B-)
Will you submit a patch (then you can assign it to yourself)?
Updated by Kay Strobach over 12 years ago
i'll make a patch
target version = 6.0 - correct?
intval('34a') = 34 != 34a intval('a23') = 0 != a23 intval('2a3') = 2 != 2a3
So where is the problem? ;)
Updated by Jigal van Hemert over 12 years ago
intval() produces an integer. If you do a non-strict comparison with a non-numerical value PHP will convert it to a number.
So, it's not actually any value for which it will be TRUE, but only for values which would evaluate to an integer number or no number at all (and become zero).
intval('a23') == 'a23' -> TRUE
About the target version, yes 6.0 would be correct IMO. It changes the return value of the function, so it's kind of a breaking change which we won't like to have in existing releases.
Updated by Frans Saris about 10 years ago
- Target version set to 7.1 (Cleanup)
- Is Regression set to No
- Sprint Focus set to On Location Sprint
Updated by Jan Helke almost 10 years ago
- Status changed from Accepted to In Progress
- Assignee set to Jan Helke
Updated by Jan Helke almost 10 years ago
- Assignee changed from Jan Helke to Mateusz Wojtuła
Updated by Mateusz Wojtuła almost 10 years ago
- Status changed from In Progress to Under Review
Updated by Mateusz Wojtuła almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Updated by Anja Leichsenring about 9 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Resolved to Closed