From f93ff30cde548fc5950e60785acea28361cd9d03 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Tue, 31 Mar 2015 14:39:01 +0800 Subject: [PATCH] MDL-48605 unit_test: Fixed file_temp_cleanup_task touch should only work on temp and below dir's. With path we get temp/.. and temp/. So we were modfying moodledata dir as well and it was failing because of permission issues. --- lib/classes/task/file_temp_cleanup_task.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/classes/task/file_temp_cleanup_task.php b/lib/classes/task/file_temp_cleanup_task.php index b5aeea8d0b0..c4801fe9060 100644 --- a/lib/classes/task/file_temp_cleanup_task.php +++ b/lib/classes/task/file_temp_cleanup_task.php @@ -88,8 +88,10 @@ class file_temp_cleanup_task extends scheduled_task { } } } else { - // Return the time modified to the original date. - touch($node, $modifieddateobject[$node]); + // Return the time modified to the original date only for real files. + if ($iter->isDir() && !$iter->isDot()) { + touch($node, $modifieddateobject[$node]); + } } } }