diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 4a98d1b47ae..c050d2e973c 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -607,12 +607,14 @@ if ($_GET["propalid"])
{
if ($user->rights->propale->envoyer)
{
- $file = $conf->propal->dir_output . "/$obj->ref/$obj->ref.pdf";
- if (file_exists($file))
- {
- print "id&action=presend\">".$langs->trans("Send")."";
- }
- }
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$obj->ref);
+ $file = $conf->propal->dir_output . "/$propref/$propref.pdf";
+ if (file_exists($file))
+ {
+ print "id&action=presend\">".$langs->trans("Send")."";
+ }
+ }
}
// Delete
@@ -645,7 +647,9 @@ if ($_GET["propalid"])
*/
if ($_GET["action"] == 'send')
{
- $file = $conf->propal->dir_output . "/$propal->ref/$propal->ref.pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propal->ref);
+ $file = $conf->propal->dir_output . "/$propref/$propref.pdf";
if (file_exists($file))
{
@@ -702,8 +706,10 @@ if ($_GET["propalid"])
print '
';
- $file = $conf->propal->dir_output . "/$propal->ref/$propal->ref.pdf";
- $relativepath = "$propal->ref/$propal->ref.pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propal->ref);
+ $file = $conf->propal->dir_output . "/$propref/$propref.pdf";
+ $relativepath = "$propref/$propref.pdf";
$var=true;
diff --git a/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php b/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php
index 0e3c8bfdf98..b0c5de7fe24 100644
--- a/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php
@@ -72,7 +72,9 @@ class pdf_propale_adytek extends ModelePDFPropales
if ($conf->propal->dir_output)
{
- $dir = $conf->propal->dir_output . "/" . $propale->ref ;
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $dir = $conf->propal->dir_output . "/" . $propref ;
if (! file_exists($dir))
{
umask(0);
@@ -89,7 +91,9 @@ class pdf_propale_adytek extends ModelePDFPropales
return 0;
}
- $file = $dir . "/" . $propale->ref . ".pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $file = $dir . "/" . $propref . ".pdf";
if (file_exists($dir))
{
diff --git a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php
index 1506afc353c..a2c0e806371 100644
--- a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php
@@ -72,7 +72,9 @@ class pdf_propale_bleu extends ModelePDFPropales
if ($conf->propal->dir_output)
{
- $dir = $conf->propal->dir_output . "/" . $propale->ref ;
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $dir = $conf->propal->dir_output . "/" . $propref ;
if (! file_exists($dir))
{
umask(0);
@@ -89,7 +91,9 @@ class pdf_propale_bleu extends ModelePDFPropales
return 0;
}
- $file = $dir . "/" . $propale->ref . ".pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $file = $dir . "/" . $propref . ".pdf";
if (file_exists($dir))
{
diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
index 8e2d63549ea..d50d593a18c 100644
--- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
@@ -72,7 +72,9 @@ class pdf_propale_jaune extends ModelePDFPropales
if ($conf->propal->dir_output)
{
- $dir = $conf->propal->dir_output . "/" . $propale->ref ;
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $dir = $conf->propal->dir_output . "/" . $propref ;
if (! file_exists($dir))
{
umask(0);
@@ -89,7 +91,9 @@ class pdf_propale_jaune extends ModelePDFPropales
return 0;
}
- $file = $dir . "/" . $propale->ref . ".pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $file = $dir . "/" . $propref . ".pdf";
if (file_exists($dir))
{
diff --git a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php
index b03bed5d414..1c47af66dcd 100644
--- a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php
@@ -74,7 +74,9 @@ class pdf_propale_rouge extends ModelePDFPropales
if ($conf->propal->dir_output)
{
- $dir = $conf->propal->dir_output . "/" . $propale->ref ;
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $dir = $conf->propal->dir_output . "/" . $propref ;
if (! file_exists($dir))
{
umask(0);
@@ -91,7 +93,9 @@ class pdf_propale_rouge extends ModelePDFPropales
return 0;
}
- $file = $dir . "/" . $propale->ref . ".pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $file = $dir . "/" . $propref . ".pdf";
if (file_exists($dir))
{
diff --git a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php
index a17c09cdcf2..27849f1729a 100644
--- a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php
@@ -72,7 +72,9 @@ class pdf_propale_vert extends ModelePDFPropales
if ($conf->propal->dir_output)
{
- $dir = $conf->propal->dir_output . "/" . $propale->ref ;
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $dir = $conf->propal->dir_output . "/" . $propref ;
if (! file_exists($dir))
{
umask(0);
@@ -89,7 +91,9 @@ class pdf_propale_vert extends ModelePDFPropales
return 0;
}
- $file = $dir . "/" . $propale->ref . ".pdf";
+ $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
+ $propref = str_replace($forbidden_chars,"_",$propale->ref);
+ $file = $dir . "/" . $propref . ".pdf";
if (file_exists($dir))
{