diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 5d4d05c76..26a899bdd 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $ -| $Revision: 1.8 $ -| $Date: 2007-06-26 21:34:34 $ +| $Revision: 1.9 $ +| $Date: 2007-07-17 19:53:33 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -593,13 +593,15 @@ function process_upload() $tid = 0; } - if (isset($_FILES['file_userfile']['error']) && $_FILES['file_userfile']['error'] != 4) + if (isset($_FILES['file_userfile']['error'])) { require_once(e_HANDLER."upload_handler.php"); if ($uploaded = file_upload('/'.e_FILE."public/", "attachment", "FT{$tid}_")) { foreach($uploaded as $upload) { + if ($upload['error'] == 0) + { if(strstr($upload['type'], "image")) { if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0) @@ -645,9 +647,18 @@ function process_upload() //echo "
"; print_r($upload); echo ""; $_POST['post'] .= "[br][file=".e_FILE."public/".$upload['name']."]".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."[/file]"; } - + } + else + { // Error in uploaded file + echo "Error in uploaded file: ".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."