diff --git a/mod/forum/lib.php b/mod/forum/lib.php index bd9423e42a7..b2763d9b415 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -2615,7 +2615,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="") {