Skip to content
Snippets Groups Projects
Commit ece84e97 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Error on close

parent cec6b447
No related branches found
No related tags found
No related merge requests found
<?php <?php
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -186,7 +186,9 @@ if ($what == 'mysql') ...@@ -186,7 +186,9 @@ if ($what == 'mysql')
if ($compression == 'bz') $handle = bzopen($outputfile, 'r'); if ($compression == 'bz') $handle = bzopen($outputfile, 'r');
if ($handle) if ($handle)
{ {
$errormsg = fgets($handle,2048); // Get 2048 first chars of error message. // Get 2048 first chars of error message.
$errormsg = fgets($handle,2048);
// Close file
if ($compression == 'none') fclose($handle); if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle); if ($compression == 'gz') gzclose($handle);
if ($compression == 'bz') bzclose($handle); if ($compression == 'bz') bzclose($handle);
...@@ -201,7 +203,6 @@ if ($what == 'mysql') ...@@ -201,7 +203,6 @@ if ($what == 'mysql')
if (! $errormsg) $errormsg=$langs->trans("ErrorFailedToRunExternalCommand"); if (! $errormsg) $errormsg=$langs->trans("ErrorFailedToRunExternalCommand");
} }
} }
fclose($handle);
// Fin execution commande // Fin execution commande
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment