Vergleich inc/functions_upload.php - 1.03 - 1.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
function remove_attachment($pid, $posthash, $aid)
{
global $db, $mybb;

function remove_attachment($pid, $posthash, $aid)
{
global $db, $mybb;

 
	$aid = intval($aid);
$posthash = addslashes($posthash);

	if($posthash != "" && !$pid)
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE aid='$aid' AND posthash='$posthash'");

	if($posthash != "" && !$pid)
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE aid='$aid' AND posthash='$posthash'");

Zeile 33Zeile 35
function remove_attachments($pid, $posthash="")
{
global $db, $mybb;

function remove_attachments($pid, $posthash="")
{
global $db, $mybb;

 
	$posthash = addslashes($posthash);

	if($posthash != "" && !$pid)
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE posthash='$posthash'");

	if($posthash != "" && !$pid)
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE posthash='$posthash'");

Zeile 108Zeile 111
		$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);