Fix generation of ODT (test if temporary directory is writable)

This commit is contained in:
Laurent Destailleur
2021-06-20 05:11:46 +02:00
parent 1a6647e690
commit e3e2dfd764
26 changed files with 162 additions and 57 deletions

View File

@@ -186,6 +186,11 @@ class modPhpbarcode extends ModeleBarCode
global $conf, $filebarcode;
dol_mkdir($conf->barcode->dir_temp);
if (!is_writable($conf->barcode->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
$file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';