|
This can be duplicated by going to the course files and adding a directory named "0". When the data is backed up, that directory and all files/directories added after it will not be in the backup. If the name of the directory is changed from "0" the backup will proceed correctly.
Those functions may all run with absolute paths, but internally they do not use them. readdir returns a filename and not a path, so the code that uses: $file=readdir($dir) as a condition will fail incorrectly at times. The php manual makes an explicit note of this. (http://us3.php.net/readdir 100% agree. Going to propose this to be changed across Moodle code... thanks!
While you're looking at files, Nicolas, can you look into this?
Raising this to blokcer because of
This actually affects all versions from 1.6 onwards: 13 files (the same in each version) have incorrect iterations through readdir(). I fixed them all by simply adding ...
false !== ([code]) ... as suggested in the php doc. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
but that only can happen if we are talking about relative paths (where a "0" dir name can have the explained effect).... but all those Moodle functions are running against absolute paths (where $CFG->dataroot is prepended).
So, perhaps it's impossible in real life?
Thanks and ciao