Vergleich attachment.php - 1.8.6 - 1.8.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 52Zeile 52
{
error($lang->error_invalidattachment);
}

{
error($lang->error_invalidattachment);
}

 

$attachtypes = (array)$cache->read('attachtypes');
$ext = get_extension($attachment['filename']);

if(empty($attachtypes[$ext]))
{
error($lang->error_invalidattachment);
}

$attachtype = $attachtypes[$ext];


$pid = $attachment['pid'];

// Don't check the permissions on preview
if($pid || $attachment['uid'] != $mybb->user['uid'])


$pid = $attachment['pid'];

// Don't check the permissions on preview
if($pid || $attachment['uid'] != $mybb->user['uid'])

{

{

	$post = get_post($pid);
$thread = get_thread($post['tid']);


	$post = get_post($pid);
$thread = get_thread($post['tid']);


Zeile 69Zeile 79

// Get forum info
$forum = get_forum($fid);


// Get forum info
$forum = get_forum($fid);





	// Permissions
$forumpermissions = forum_permissions($fid);

if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']) || ($forumpermissions['candlattachments'] == 0 && !$mybb->input['thumbnail']))

	// Permissions
$forumpermissions = forum_permissions($fid);

if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']) || ($forumpermissions['candlattachments'] == 0 && !$mybb->input['thumbnail']))

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 82Zeile 92
	if(!$attachment['attachname'] || (!is_moderator($fid, "canviewunapprove") && ($attachment['visible'] != 1 || $thread['visible'] != 1 || $post['visible'] != 1)))
{
error($lang->error_invalidattachment);

	if(!$attachment['attachname'] || (!is_moderator($fid, "canviewunapprove") && ($attachment['visible'] != 1 || $thread['visible'] != 1 || $post['visible'] != 1)))
{
error($lang->error_invalidattachment);

	}






	}

if($attachtype['forums'] != -1 && strpos(','.$attachtype['forums'].',', ','.$fid.',') === false)
{
error_no_permission();
}

}

}





if(!isset($mybb->input['thumbnail'])) // Only increment the download count if this is not a thumbnail
{

if(!isset($mybb->input['thumbnail'])) // Only increment the download count if this is not a thumbnail
{

 
	if(!is_member($attachtype['groups']))
{
error_no_permission();
}


	$attachupdate = array(
"downloads" => $attachment['downloads']+1,
);

	$attachupdate = array(
"downloads" => $attachment['downloads']+1,
);