diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 6f75db0b150..e78cf55d344 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -532,13 +532,13 @@ class Utils } elseif ($compression == 'zstd') { fclose($handle); } - if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error + if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error $errormsg = ''; } else { - // Renommer fichier sortie en fichier erreur + // Rename file out into a file error //print "$outputfile -> $outputerror"; @dol_delete_file($outputerror, 1, 0, 0, null, false, 0); - @rename($outputfile, $outputerror); + @dol_move($outputfile, $outputerror, '0', 1, 0, 0); // Si safe_mode on et command hors du parametre exec, on a un fichier out vide donc errormsg vide if (!$errormsg) { $langs->load("errors");