diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 51a50c6376c..564a41ab7a0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2022 Charlene Benke * * 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 @@ -625,7 +626,7 @@ if ($step == 3 && $datatoimport) { $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; if ($maxmin > 0) { - $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + print ''; // MAX_FILE_SIZE must precede the field type=file } print '     '; $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); @@ -635,29 +636,29 @@ if ($step == 3 && $datatoimport) { $max = $conf->global->MAIN_UPLOAD_DOC; // In Kb $maxphp = @ini_get('upload_max_filesize'); // In unknown if (preg_match('/k$/i', $maxphp)) { - $maxphp = $maxphp * 1; + $maxphp = (int) substr($maxphp, 0, -1) * 1; } if (preg_match('/m$/i', $maxphp)) { - $maxphp = $maxphp * 1024; + $maxphp = (int) substr($maxphp, 0, -1) * 1024; } if (preg_match('/g$/i', $maxphp)) { - $maxphp = $maxphp * 1024 * 1024; + $maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024; } if (preg_match('/t$/i', $maxphp)) { - $maxphp = $maxphp * 1024 * 1024 * 1024; + $maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024 * 1024; } $maxphp2 = @ini_get('post_max_size'); // In unknown if (preg_match('/k$/i', $maxphp2)) { - $maxphp2 = $maxphp2 * 1; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1; } if (preg_match('/m$/i', $maxphp2)) { - $maxphp2 = $maxphp2 * 1024; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024; } if (preg_match('/g$/i', $maxphp2)) { - $maxphp2 = $maxphp2 * 1024 * 1024; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024; } if (preg_match('/t$/i', $maxphp2)) { - $maxphp2 = $maxphp2 * 1024 * 1024 * 1024; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024 * 1024; } // Now $max and $maxphp and $maxphp2 are in Kb $maxmin = $max;