Merge branch 'MDL-45654-27' of https://github.com/rtcn2/moodle into MOODLE_27_STABLE
This commit is contained in:
@@ -60,8 +60,11 @@ class file_temp_cleanup_task extends scheduled_task {
|
||||
// Check if file or directory is older than the given time.
|
||||
if ($iter->getMTime() < $time) {
|
||||
if ($iter->isDir() && !$iter->isDot()) {
|
||||
if (@rmdir($node) === false) {
|
||||
mtrace("Failed removing directory '$node'.");
|
||||
// Don't attempt to delete the directory if it isn't empty.
|
||||
if (!glob($node. DIRECTORY_SEPARATOR . '*')) {
|
||||
if (@rmdir($node) === false) {
|
||||
mtrace("Failed removing directory '$node'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($iter->isFile()) {
|
||||
|
||||
Reference in New Issue
Block a user