Vergleich attachment.php - 1.6.8 - 1.6.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: attachment.php 5799 2012-04-19 15:06:30Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

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


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


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

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

{
error_no_permission();
}

// Error if attachment is invalid or not visible

{
error_no_permission();
}

// Error if attachment is invalid or not visible

if(!$attachment['aid'] || !$attachment['attachname'] || (!is_moderator($fid) && $attachment['visible'] != 1))

if(!$attachment['aid'] || !$attachment['attachname'] || (!is_moderator($fid) && ($attachment['visible'] != 1 || $thread['visible'] != 1 || $post['visible'] != 1)))

{
error($lang->error_invalidattachment);
}

{
error($lang->error_invalidattachment);
}

Zeile 107Zeile 107
	header("Content-type: ".$type);
$thumb = $mybb->settings['uploadspath']."/".$attachment['thumbnail'];
header("Content-length: ".@filesize($thumb));

	header("Content-type: ".$type);
$thumb = $mybb->settings['uploadspath']."/".$attachment['thumbnail'];
header("Content-length: ".@filesize($thumb));

	echo file_get_contents($thumb);






	$handle = fopen($thumb, 'rb');
while(!feof($handle))
{
echo fread($handle, 8192);
}
fclose($handle);

}
else
{

}
else
{

Zeile 136Zeile 141

header("Content-type: {$filetype}");
$disposition = "attachment";


header("Content-type: {$filetype}");
$disposition = "attachment";

	}

	}


if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "msie") !== false)
{
header("Content-disposition: attachment; filename=\"{$attachment['filename']}\"");


if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "msie") !== false)
{
header("Content-disposition: attachment; filename=\"{$attachment['filename']}\"");

	}

	}

	else
{
header("Content-disposition: {$disposition}; filename=\"{$attachment['filename']}\"");

	else
{
header("Content-disposition: {$disposition}; filename=\"{$attachment['filename']}\"");

Zeile 153Zeile 158
	}

header("Content-length: {$attachment['filesize']}");

	}

header("Content-length: {$attachment['filesize']}");

	header("Content-range: bytes=0-".($attachment['filesize']-1)."/".$attachment['filesize']); 
echo file_get_contents($mybb->settings['uploadspath']."/".$attachment['attachname']);






	header("Content-range: bytes=0-".($attachment['filesize']-1)."/".$attachment['filesize']);
$handle = fopen($mybb->settings['uploadspath']."/".$attachment['attachname'], 'rb');
while(!feof($handle))
{
echo fread($handle, 8192);
}
fclose($handle);

}
?>

}
?>