From 1f52eab1c2112e3dadae6aa33c7d34bf4fc08e4e Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 27 Sep 2009 09:50:11 +0000 Subject: [PATCH] MDL-19718 fixed critical race condition when deleting posts - credit goes to Ashley Holman; backported from MOODLE_19_STABLE --- mod/forum/lib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 0b1dd0f58c5..d3ef01894dd 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -2320,7 +2320,12 @@ function forum_file_area_name($post) { } function forum_file_area($post) { - return make_upload_directory( forum_file_area_name($post) ); + $path = forum_file_area_name($post); + if ($path) { + return make_upload_directory($path); + } else { + return false; + } } function forum_delete_old_attachments($post, $exception="") {