diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 396314ec58..05dee829fa 100644 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -332,7 +332,7 @@ function show_add_forum_form($inputvalues=array()) { } $forum_image=isset($inputvalues['forum_image']) ? $inputvalues['forum_image'] : ''; $form->addElement('file', 'picture', ($forum_image != '' ? get_lang('UpdateImage') : get_lang('AddImage'))); - $form->addRule('picture', get_lang('OnlyImagesAllowed'), 'mimetype', array('image/gif', 'image/jpeg', 'image/png')); + $form->addRule('picture', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif')); $form->addElement('html',''); // The OK button diff --git a/main/forum/index.php b/main/forum/index.php index c8bdf4a39c..aeac5a63dc 100644 --- a/main/forum/index.php +++ b/main/forum/index.php @@ -372,7 +372,12 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte echo "\t\t"; if(!empty($forum['forum_image'])) { $image_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/forum/images/'.$forum['forum_image']; + + /* $image_size = @getimagesize($image_path); + */ + $image_size = @getimagesize(api_url_to_local_path($image_path)); + $img_attributes = ''; if (!empty($image_size)) { if ($image_size[0] > 100 || $image_size[1] > 100) {