Vergleich inc/functions_upload.php - 1.2.9 - 1.2.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * $Id: functions_upload.php 3135 2007-06-14 20:10:46Z dennis $

 * $Id: functions_upload.php 4005 2008-07-10 17:53:25Z Tikitiki $

 */



 */



Zeile 71Zeile 71
	$posthash = $db->escape_string($posthash);
if($posthash != "" && !$pid)
{

	$posthash = $db->escape_string($posthash);
if($posthash != "" && !$pid)
{

	  $query = $db->simple_select(TABLE_PREFIX."attachments", "*", "posthash='$posthash'");

	  	$query = $db->simple_select(TABLE_PREFIX."attachments", "*", "posthash='$posthash'");

	}
else
{

	}
else
{

Zeile 94Zeile 94
			@unlink($mybb->settings['uploadspath']."/".$attachment['thumbnail']);
}
}

			@unlink($mybb->settings['uploadspath']."/".$attachment['thumbnail']);
}
}

	if($post['pid']) 

	if($post['tid']) 

 	{ 
update_thread_counters($post['tid'], array("attachmentcount" => "-{$num_attachments}"));
}

 	{ 
update_thread_counters($post['tid'], array("attachmentcount" => "-{$num_attachments}"));
}

Zeile 158Zeile 158
	$file = upload_file($avatar, $mybb->settings['avataruploadpath'], $filename);
if($file['error'])
{

	$file = upload_file($avatar, $mybb->settings['avataruploadpath'], $filename);
if($file['error'])
{

 
		@unlink($mybb->settings['avataruploadpath']."/".$filename);		

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

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

Zeile 173Zeile 174
	$img_dimensions = @getimagesize($mybb->settings['avataruploadpath']."/".$filename);
if(!is_array($img_dimensions))
{

	$img_dimensions = @getimagesize($mybb->settings['avataruploadpath']."/".$filename);
if(!is_array($img_dimensions))
{

 
		@unlink($mybb->settings['avataruploadpath']."/".$filename);		

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

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

Zeile 201Zeile 203
	// Check if the uploaded file type matches the correct image type (returned by getimagesize)
if($img_dimensions[2] != $img_type || $img_type == 0)
{

	// Check if the uploaded file type matches the correct image type (returned by getimagesize)
if($img_dimensions[2] != $img_type || $img_type == 0)
{

 
		@unlink($mybb->settings['avataruploadpath']."/".$filename);		

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

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

Zeile 407Zeile 410
	$plugins->run_hooks_by_ref("upload_attachment_do_insert", $attacharray);

$db->insert_query(TABLE_PREFIX."attachments", $attacharray);

	$plugins->run_hooks_by_ref("upload_attachment_do_insert", $attacharray);

$db->insert_query(TABLE_PREFIX."attachments", $attacharray);

	
if($attacharray['pid'] > 0)

	if($tid) 


	{

	{

		$post = get_post($attacharray['pid']); 
update_thread_counters($post['tid'], array("attachmentcount" => +1));

		update_thread_counters($tid, array("attachmentcount" => "+1")); 


	}

$aid = $db->insert_id();

	}

$aid = $db->insert_id();