From 36257d39d55ea53e1790f8d37260ff18fd781a2d Mon Sep 17 00:00:00 2001
From: moodler <moodler>
Date: Sun, 25 Apr 2004 02:15:48 +0000
Subject: [PATCH] Check attachment variable to prevent warnings

---
 mod/forum/post.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mod/forum/post.php b/mod/forum/post.php
index 45ddbdb6b8..82fd8e3dee 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;
-- 
2.39.5