Fix PhanTypeInvalid{Left,Right}OperandOfNumericOp mostly by typing, casting, idate

This commit is contained in:
MDW 2024-03-23 01:12:23 +01:00
parent 58ca5d112d
commit cb68c95504
No known key found for this signature in database

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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);
}