diff --git a/mod/forum/post.php b/mod/forum/post.php index 45ddbdb6b8e..82fd8e3dee7 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -25,7 +25,7 @@ $post->message = clean_text($post->message, $post->format); // Clean up any bad tags - $post->attachment = $_FILES["attachment"]; + $post->attachment = isset($_FILES['attachment']) ? $_FILES['attachment'] : NULL; if (!$cm = get_coursemodule_from_instance("forum", $post->forum, $post->course)) { // For the logs $cm->id = 0;