Revision 379
Added by Matthias almost 18 years ago
trunk/wb/modules/news/save_group.php | ||
---|---|---|
57 | 57 |
$filename = $_FILES['image']['name']; |
58 | 58 |
$new_filename = WB_PATH.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg'; |
59 | 59 |
// Make sure the image is a jpg file |
60 |
if(substr($filename, -3, 3) != 'jpg') { |
|
61 |
$admin->print_error($MESSAGE['GENERIC']['FILE_TYPE'].' JPG (JPEG)'); |
|
62 |
} elseif(mime_content_type($_FILES['image']['tmp_name']) != 'image/jpeg' AND mime_content_type($_FILES['image']['tmp_name']) != 'image/jpg') { |
|
63 |
$admin->print_error($MESSAGE['GENERIC']['FILE_TYPE'].' JPG (JPEG)'); |
|
60 |
$file3=substr($filename, -3, 3); |
|
61 |
$file4=substr($filename, -4, 4); |
|
62 |
//echo $file3; |
|
63 |
//echo $file4; |
|
64 |
if(($file4 != '.jpg')and($file4 != '.JPG')and($file4 != '.png')and($file4 != '.PNG') and ($file4 !='.jpeg') and ($file4 != '.JPEG')) { |
|
65 |
$admin->print_error($MESSAGE['GENERIC']['FILE_TYPE'].' JPG (JPEG) or PNG a'); |
|
66 |
} elseif( |
|
67 |
(($_FILES['image']['type']) != 'image/jpeg' AND mime_content_type($_FILES['image']['tmp_name']) != 'image/jpg') |
|
68 |
and |
|
69 |
(($_FILES['image']['type']) != 'image/png' AND mime_content_type($_FILES['image']['tmp_name']) != 'image/png') |
|
70 |
){ |
|
71 |
$admin->print_error($MESSAGE['GENERIC']['FILE_TYPE'].' JPG (JPEG) or PNG b'); |
|
64 | 72 |
} |
65 | 73 |
// Make sure the target directory exists |
66 | 74 |
make_dir(WB_PATH.MEDIA_DIRECTORY.'/.news'); |
Also available in: Unified diff
Fixed group images in news modul cannot be stored (#342)