refactoring

This commit is contained in:
Milos Stojanovic
2019-06-14 12:46:45 +02:00
parent 667389ab1a
commit f6185c92ab
14 changed files with 1019 additions and 34 deletions

View File

@@ -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

View File

@@ -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');