From cb68c955041ecd059cb4b4d043bcd8271196a378 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 23 Mar 2024 01:12:23 +0100 Subject: [PATCH] Fix PhanTypeInvalid{Left,Right}OperandOfNumericOp mostly by typing, casting, idate --- htdocs/core/ajax/flowjs-server.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/flowjs-server.php b/htdocs/core/ajax/flowjs-server.php index 73617cbc008..dfe8b4ad2ce 100644 --- a/htdocs/core/ajax/flowjs-server.php +++ b/htdocs/core/ajax/flowjs-server.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -162,10 +163,10 @@ function createFileFromChunks($temp_dir, $upload_dir, $fileName, $chunkSize, $to // check that all the parts are present // the size of the last part is between chunkSize and 2*$chunkSize - if ($total_files * $chunkSize >= ($totalSize - $chunkSize + 1)) { + if ($total_files * (float) $chunkSize >= ((float) $totalSize - (float) $chunkSize + 1)) { // create the final destination file if (($fp = fopen($upload_dir.'/'.$fileName, 'w')) !== false) { - for ($i=1; $i<=$total_files; $i++) { + for ($i = 1; $i <= $total_files; $i++) { fwrite($fp, file_get_contents($temp_dir.'/'.$fileName.'.part'.$i)); dol_syslog('writing chunk '.$i); }