Qual: Add more checks
This commit is contained in:
parent
14f2639f4e
commit
cfa45be7d4
@ -217,6 +217,7 @@ class Export
|
||||
// Build the sql request
|
||||
$sql=$this->array_export_sql_start[$indice];
|
||||
$i=0;
|
||||
|
||||
//print_r($array_selected);
|
||||
foreach ($this->array_export_fields[$indice] as $key => $value)
|
||||
{
|
||||
@ -253,7 +254,14 @@ class Export
|
||||
asort($array_selected);
|
||||
|
||||
dol_syslog("Export::build_file $model, $datatoexport, $array_selected");
|
||||
|
||||
|
||||
// Check parameters or context properties
|
||||
if (! is_array($this->array_export_fields[$indice]))
|
||||
{
|
||||
$this->error="ErrorBadParameter";
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Creation de la classe d'export du model ExportXXX
|
||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/export/";
|
||||
$file = "export_".$model.".modules.php";
|
||||
@ -278,7 +286,7 @@ class Export
|
||||
$outputlangs=$langs; // Lang for output
|
||||
|
||||
// Open file
|
||||
create_exdir($dirname);
|
||||
dol_mkdir($dirname);
|
||||
$result=$objmodel->open_file($dirname."/".$filename, $outputlangs);
|
||||
|
||||
if ($result >= 0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user