From 7f1a37da3e8c6642bf3bcefe6768169250b342d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Tue, 23 Aug 2022 12:26:21 +0200 Subject: [PATCH 1/3] php V8 warning, import max size not used --- htdocs/imports/import.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 51a50c6376c..2807b908f23 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 @@ -624,9 +625,9 @@ if ($step == 3 && $datatoimport) { print '
'; $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; - if ($maxmin > 0) { - $texte .= ''; // MAX_FILE_SIZE must precede the field type=file - } + //if ($maxmin > 0) { + // $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + //} print '     '; $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); print ''; @@ -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; From 1e311a250f2ffc161d9138888b4b6e11be9f35f2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 23 Aug 2022 10:30:42 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/imports/import.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 2807b908f23..deacb660b89 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -636,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 = (int)substr($maxphp, 0, -1) * 1; + $maxphp = (int) substr($maxphp, 0, -1) * 1; } if (preg_match('/m$/i', $maxphp)) { - $maxphp = (int)substr($maxphp, 0, -1) * 1024; + $maxphp = (int) substr($maxphp, 0, -1) * 1024; } if (preg_match('/g$/i', $maxphp)) { - $maxphp = (int)substr($maxphp, 0, -1) * 1024 * 1024; + $maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024; } if (preg_match('/t$/i', $maxphp)) { - $maxphp = (int)substr($maxphp, 0, -1) * 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 = (int)substr($maxphp2, 0, -1) * 1; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1; } if (preg_match('/m$/i', $maxphp2)) { - $maxphp2 = (int)substr($maxphp2, 0, -1) * 1024; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024; } if (preg_match('/g$/i', $maxphp2)) { - $maxphp2 = (int)substr($maxphp2, 0, -1) * 1024 * 1024; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024; } if (preg_match('/t$/i', $maxphp2)) { - $maxphp2 = (int)substr($maxphp2, 0, -1) * 1024 * 1024 * 1024; + $maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024 * 1024; } // Now $max and $maxphp and $maxphp2 are in Kb $maxmin = $max; From 0319dff9d63de7dcd8fd98931514abde9a6abaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Wed, 24 Aug 2022 18:55:47 +0200 Subject: [PATCH 3/3] Update import.php --- htdocs/imports/import.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index deacb660b89..564a41ab7a0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -625,9 +625,9 @@ if ($step == 3 && $datatoimport) { print '
'; $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; - //if ($maxmin > 0) { - // $texte .= ''; // MAX_FILE_SIZE must precede the field type=file - //} + if ($maxmin > 0) { + print ''; // MAX_FILE_SIZE must precede the field type=file + } print '     '; $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); print '';