Add more explicit type casts

This commit is contained in:
Dennis Eichhorn 2017-11-17 19:13:39 +01:00
parent aa90c5cce5
commit 0e8a5cac55

View File

@ -248,7 +248,7 @@ class Controller extends ModuleAbstract implements WebInterface
// todo: implement limit since this could get exploited // todo: implement limit since this could get exploited
do { do {
$filename = sha1($request->getData('image') . $rnd); $filename = sha1(((string) $request->getData('image')) . $rnd);
$filename .= '.' . $extension; $filename .= '.' . $extension;
$rnd = mt_rand(); $rnd = mt_rand();
@ -256,12 +256,12 @@ class Controller extends ModuleAbstract implements WebInterface
$fullPath = __DIR__ . '/../../' . $path . '/' . $filename; $fullPath = __DIR__ . '/../../' . $path . '/' . $filename;
$this->createLocalFile($fullPath, $request->getData('image')); $this->createLocalFile($fullPath, (string) $request->getData('image'));
$status = [ $status = [
'path' => $path, 'path' => $path,
'filename' => $filename, 'filename' => $filename,
'name' => $request->getData('title'), 'name' => (string) $request->getData('title'),
'size' => File::size($fullPath), 'size' => File::size($fullPath),
'extension' => $extension, 'extension' => $extension,
'status' => UploadStatus::OK, 'status' => UploadStatus::OK,