$filename .= "/".item_img_name($stock_id).".jpg";
//But check for the worst
- $imagetype = exif_imagetype($_FILES['pic']['tmp_name']);
+ if ((list($width, $height, $type, $attr) = getimagesize($_FILES['pic']['tmp_name'])) !== false)
+ $imagetype = $type;
+ else
+ $imagetype = false;
+ //$imagetype = exif_imagetype($_FILES['pic']['tmp_name']);
if ($imagetype != IMAGETYPE_GIF && $imagetype != IMAGETYPE_JPEG && $imagetype != IMAGETYPE_PNG)
{ //File type Check
display_warning( _('Only graphics files can be uploaded'));
$upload_file ='No';
}
- elseif (strtoupper(substr(trim($_FILES['pic']['name']), in_array(strlen($_FILES['pic']['name']) - 3)), array('JPG','PNG','GIF')))
+ elseif (@strtoupper(substr(trim($_FILES['pic']['name']), @in_array(strlen($_FILES['pic']['name']) - 3)), array('JPG','PNG','GIF')))
{
display_warning(_('Only graphics files are supported - a file extension of .jpg, .png or .gif is expected'));
$upload_file ='No';