mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-12 04:38:06 +00:00
Code cleanup.
This commit is contained in:
@@ -44,8 +44,6 @@ class IndexController extends Controller
|
||||
|
||||
/**
|
||||
* IndexController constructor.
|
||||
*
|
||||
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -65,7 +63,6 @@ class IndexController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LaravelResponse
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
@@ -90,19 +87,21 @@ class IndexController extends Controller
|
||||
|
||||
$name = sprintf('%s_transaction_export.csv', date('Y_m_d'));
|
||||
$quoted = sprintf('"%s"', addcslashes($name, '"\\'));
|
||||
|
||||
// headers for CSV file.
|
||||
/** @var LaravelResponse $response */
|
||||
$response = response($result['transactions']);
|
||||
$response
|
||||
->header('Content-Description', 'File Transfer')
|
||||
->header('Content-Type', 'text/x-csv')
|
||||
->header('Content-Disposition', 'attachment; filename=' . $quoted)
|
||||
//->header('Content-Transfer-Encoding', 'binary')
|
||||
->header('Content-Disposition', 'attachment; filename='.$quoted)
|
||||
// ->header('Content-Transfer-Encoding', 'binary')
|
||||
->header('Connection', 'Keep-Alive')
|
||||
->header('Expires', '0')
|
||||
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
|
||||
->header('Pragma', 'public')
|
||||
->header('Content-Length', (string)strlen($result['transactions']));
|
||||
->header('Content-Length', (string)strlen($result['transactions']))
|
||||
;
|
||||
|
||||
// return CSV file made from 'transactions' array.
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user