From a08fa814ec0123432102a059a598c3b8be552886 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Mon, 22 Feb 2016 13:32:01 +0100
Subject: [PATCH] Better filter to exclude mysqldump warning

---
 htdocs/admin/tools/export.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php
index 81708e53e31..3a25ceadfe6 100644
--- a/htdocs/admin/tools/export.php
+++ b/htdocs/admin/tools/export.php
@@ -198,10 +198,12 @@ if ($what == 'mysql')
         $ok=0;
         dol_syslog("Run command ".$fullcommandcrypted);
         $handlein = popen($fullcommandclear, 'r');
+        $i=0;
         while (!feof($handlein))
         {
+            $i++;   // output line number
             $read = fgets($handlein);
-            if (preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue;
+            if ($i == 1 && preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue;
             fwrite($handle,$read);
             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;
-- 
GitLab