szurubooru/src/Views/layout-file.phtml
2013-10-13 22:54:16 +02:00

22 lines
530 B
PHTML

<?php
if (!empty($this->context->transport->errorMessage))
{
\Chibi\HeadersHelper::set('Content-Type', 'text/plain; charset=utf-8');
echo $this->context->transport->errorMessage;
}
else
{
if (isset($this->context->transport->customFileName))
{
\Chibi\HeadersHelper::set(
'Content-Disposition',
'inline; filename="' . $this->context->transport->customFileName . '"');
}
\Chibi\HeadersHelper::set(
'Content-Type',
$this->context->transport->mimeType);
readfile($this->context->transport->filePath);
flush();
}