FIX avoid infinite loop on dump with popen

This commit is contained in:
Laurent Destailleur 2022-01-07 15:35:33 +01:00
parent eb7dd74026
commit 10e32c056e

View File

@ -291,6 +291,7 @@ class Utils
$ok=0; $ok=0;
dol_syslog("Run command ".$fullcommandcrypted); dol_syslog("Run command ".$fullcommandcrypted);
$handlein = popen($fullcommandclear, 'r'); $handlein = popen($fullcommandclear, 'r');
if ($handlein) {
$i=0; $i=0;
while (!feof($handlein)) while (!feof($handlein))
{ {
@ -303,6 +304,7 @@ class Utils
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
} }
pclose($handlein); pclose($handlein);
}
if ($compression == 'none') fclose($handle); if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle); if ($compression == 'gz') gzclose($handle);