diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index e10b5530f52..6b0ea790ab2 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -129,7 +129,7 @@ if ($what == 'mysql') { $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); $ok=0; - dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that on of this command is inside ".$cmddump); + dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump); foreach($arrayofallowedcommand as $allowedcommand) { if (preg_match('/'.preg_quote($allowedcommand,'/').'/', $cmddump)) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index b0b641eca57..ec95063906c 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -291,12 +291,11 @@ class Utils if ($handle) { - $execmethod=1; if (! empty($conf->global->MAIN_EXEC_USE_POPEN)) $execmethod=$conf->global->MAIN_EXEC_USE_POPEN; if (empty($execmethod)) $execmethod=1; $ok=0; - dol_syslog("Run command with method ".$execmethod." with ".$fullcommandcrypted); + dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_DEBUG); // TODO Replace with executeCLI function if ($execmethod == 1) @@ -319,7 +318,7 @@ class Utils { $i++; // output line number if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; - fwrite($handle,$read); + fwrite($handle, $read.($execmethod == 2 ? '' : "\n")); if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; }