Missing files and dirs because of readdir comparison
phpFileManager a complete filesystem management tool on a single file.
Brought to you by:
dulldusk
At several places the application uses a WHILE loop to retrieve teh content of a directory with READDIR. However, the comparison used in the condition of the WHILE loop is incorrect, missing some files and dirs.
For example, in the original code:
while ($file = readdir($handle)){
the correct way to test for the end of the dir listing is:
while (false !== ($file = readdir($handle))){
In the current state, if a directory has a directory or file named "0" (zero), it the loop would be finished earlier.
In the current version (0.9.3), there are only 6 places to fix this.
Attached is the unified diff patch for reference.
Regards,
Mario A. Valdez-Ramirez.
Patch fix in unified diff format.
Diff:
This was fixed on the latest release.