Fix missing var init

This commit is contained in:
Laurent Destailleur 2017-06-26 09:20:16 +02:00
parent 1b3544e794
commit 85ce1f3332

View File

@ -88,6 +88,7 @@ if (!empty($ExecTimeLimit))
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64 @set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err); error_reporting($err);
} }
$MemoryLimit=0;
if (!empty($MemoryLimit)) if (!empty($MemoryLimit))
{ {
@ini_set('memory_limit', $MemoryLimit); @ini_set('memory_limit', $MemoryLimit);
@ -120,10 +121,10 @@ $utils = new Utils($db);
// MYSQL // MYSQL
if ($what == 'mysql') if ($what == 'mysql')
{ {
$cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg $cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
$cmddump=dol_sanitizePathName($cmddump); $cmddump=dol_sanitizePathName($cmddump);
if (! empty($dolibarr_main_restrict_os_commands)) if (! empty($dolibarr_main_restrict_os_commands))
{ {
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
@ -142,13 +143,13 @@ if ($what == 'mysql')
$errormsg=$langs->trans('CommandIsNotInsideAllowedCommands'); $errormsg=$langs->trans('CommandIsNotInsideAllowedCommands');
} }
} }
if (! $errormsg && $cmddump) if (! $errormsg && $cmddump)
{ {
dolibarr_set_const($db, 'SYSTEMTOOLS_MYSQLDUMP', $cmddump,'chaine',0,'',$conf->entity); dolibarr_set_const($db, 'SYSTEMTOOLS_MYSQLDUMP', $cmddump,'chaine',0,'',$conf->entity);
} }
if (! $errormsg) if (! $errormsg)
{ {
$utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file); $utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file);
$errormsg=$utils->error; $errormsg=$utils->error;
@ -172,13 +173,13 @@ if ($what == 'postgresql')
{ {
$cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg $cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
$cmddump=dol_sanitizePathName($cmddump); $cmddump=dol_sanitizePathName($cmddump);
if (! $errormsg && $cmddump) if (! $errormsg && $cmddump)
{ {
dolibarr_set_const($db, 'SYSTEMTOOLS_POSTGRESQLDUMP', $cmddump,'chaine',0,'',$conf->entity); dolibarr_set_const($db, 'SYSTEMTOOLS_POSTGRESQLDUMP', $cmddump,'chaine',0,'',$conf->entity);
} }
if (! $errormsg) if (! $errormsg)
{ {
$utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file); $utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file);
$errormsg=$utils->error; $errormsg=$utils->error;