mirror of
https://github.com/filegator/filegator.git
synced 2025-07-31 21:20:18 +02:00
refactoring
This commit is contained in:
@@ -46,7 +46,7 @@ class DownloadController
|
||||
public function download($path_encoded, Request $request, Response $response, StreamedResponse $streamedResponse)
|
||||
{
|
||||
try {
|
||||
$file = $this->storage->readStream(base64_decode($path_encoded));
|
||||
$file = $this->storage->readStream((string) base64_decode($path_encoded));
|
||||
} catch (\Exception $e) {
|
||||
return $response->redirect('/');
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class DownloadController
|
||||
|
||||
public function batchDownloadStart(Request $request, StreamedResponse $streamedResponse, TmpfsInterface $tmpfs)
|
||||
{
|
||||
$uniqid = preg_replace('/[^0-9a-zA-Z_]/', '', $request->input('uniqid'));
|
||||
$uniqid = (string) preg_replace('/[^0-9a-zA-Z_]/', '', (string) $request->input('uniqid'));
|
||||
|
||||
$streamedResponse->setCallback(function () use ($tmpfs, $uniqid) {
|
||||
// @codeCoverageIgnoreStart
|
||||
|
@@ -42,7 +42,7 @@ class UploadController
|
||||
public function chunkCheck(Request $request, Response $response)
|
||||
{
|
||||
$file_name = $request->input('resumableFilename', 'file');
|
||||
$identifier = preg_replace('/[^0-9a-zA-Z_]/', '', $request->input('resumableIdentifier'));
|
||||
$identifier = (string) preg_replace('/[^0-9a-zA-Z_]/', '', (string) $request->input('resumableIdentifier'));
|
||||
$chunk_number = (int) $request->input('resumableChunkNumber');
|
||||
|
||||
$chunk_file = 'multipart_'.$identifier.$file_name.'.part'.$chunk_number;
|
||||
@@ -61,7 +61,7 @@ class UploadController
|
||||
$chunk_number = (int) $request->input('resumableChunkNumber');
|
||||
$total_chunks = (int) $request->input('resumableTotalChunks');
|
||||
$total_size = (int) $request->input('resumableTotalSize');
|
||||
$identifier = preg_replace('/[^0-9a-zA-Z_]/', '', $request->input('resumableIdentifier'));
|
||||
$identifier = (string) preg_replace('/[^0-9a-zA-Z_]/', '', (string) $request->input('resumableIdentifier'));
|
||||
|
||||
$file = $request->files->get('file');
|
||||
|
||||
|
Reference in New Issue
Block a user