diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index de67b9c78de..990af29d90f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2056,7 +2056,7 @@ class Propal extends CommonObject { // We remove directory $ref = dol_sanitizeFileName($this->ref); - if ($conf->propal->dir_output) + if ($conf->propal->dir_output && !empty($this->ref)) { $dir = $conf->propal->dir_output . "/" . $ref ; $file = $dir . "/" . $ref . ".pdf"; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 27503790375..a2225b033b8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2457,7 +2457,7 @@ class Commande extends CommonOrder // On efface le repertoire de pdf provisoire $comref = dol_sanitizeFileName($this->ref); - if ($conf->commande->dir_output) + if ($conf->commande->dir_output && !empty($this->ref)) { $dir = $conf->commande->dir_output . "/" . $comref ; $file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 461b3606cd6..80911290521 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1323,7 +1323,7 @@ class Facture extends CommonInvoice { // On efface le repertoire de pdf provisoire $ref = dol_sanitizeFileName($this->ref); - if ($conf->facture->dir_output) + if ($conf->facture->dir_output && !empty($this->ref)) { $dir = $conf->facture->dir_output . "/" . $ref; $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";