Vergleich inc/functions_upload.php - 1.01 - 1.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 108Zeile 108
		$ret['error'] = $lang->error_uploadfailed;
return $ret;
}

		$ret['error'] = $lang->error_uploadfailed;
return $ret;
}











	
// Check if this is a valid image or not
$img_dimensions = @getimagesize($mybb->settings['avataruploadpath']."/".$filename);
if(!is_array($img_dimensions))
{
$ret['error'] = $lang->error_uploadfailed;
return $ret;
}


	// If we've got this far check dimensions
if(preg_match("#(gif|jpg|jpeg|jpe|bmp|png)$#i", $ext) && $mybb->settings['maxavatardims'] != "")
{

	// If we've got this far check dimensions
if(preg_match("#(gif|jpg|jpeg|jpe|bmp|png)$#i", $ext) && $mybb->settings['maxavatardims'] != "")
{

		list($width, $height) = @getimagesize($mybb->settings['avataruploadpath']."/".$filename);

 
		list($maxwidth, $maxheight) = @explode("x", $mybb->settings['maxavatardims']);

		list($maxwidth, $maxheight) = @explode("x", $mybb->settings['maxavatardims']);

		if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))

		if(($maxwidth && $img_dimensions[0] > $maxwidth) || ($maxheight && $img_dimensions[1] > $maxheight))

		{
$ret['error'] = sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
@unlink($mybb->settings['avataruploadpath']."/".$filename);

		{
$ret['error'] = sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
@unlink($mybb->settings['avataruploadpath']."/".$filename);

Zeile 134Zeile 141
	global $db, $theme, $templates, $posthash, $pid, $tid, $forum, $mybb, $lang;

$posthash = addslashes($mybb->input['posthash']);

	global $db, $theme, $templates, $posthash, $pid, $tid, $forum, $mybb, $lang;

$posthash = addslashes($mybb->input['posthash']);

 
	$attachment['name'] = addslashes($attachment['name']);


if(!is_uploaded_file($attachment['tmp_name']))
{


if(!is_uploaded_file($attachment['tmp_name']))
{

Zeile 171Zeile 179
	}

// Check if an attachment with this name is already in the post

	}

// Check if an attachment with this name is already in the post

	$query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE filename='".addslashes($attachment['name'])."' AND (posthash='$posthash' OR (pid='$pid' AND pid!='0'))");

	$query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE filename='".$attachment['name']."' AND (posthash='$posthash' OR (pid='$pid' AND pid!='0'))");

	$prevattach = $db->fetch_array($query);
if($prevattach['aid'])
{

	$prevattach = $db->fetch_array($query);
if($prevattach['aid'])
{