un "/" dans le numéro de propale causait une erreur de création du fichier PDF.

Le nom de fichier et de répertoire est filtré par une table forbidden_chars.
This commit is contained in:
ccomb
2005-04-02 16:40:47 +00:00
parent 3d881cecd2
commit 00eb9f33ef
6 changed files with 45 additions and 19 deletions

View File

@@ -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 "<a class=\"tabAction\" href=\"propal.php?propalid=$propal->id&amp;action=presend\">".$langs->trans("Send")."</a>";
}
}
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$propref = str_replace($forbidden_chars,"_",$obj->ref);
$file = $conf->propal->dir_output . "/$propref/$propref.pdf";
if (file_exists($file))
{
print "<a class=\"tabAction\" href=\"propal.php?propalid=$propal->id&amp;action=presend\">".$langs->trans("Send")."</a>";
}
}
}
// 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 '<table class="border" width="100%">';
$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;

View File

@@ -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))
{

View File

@@ -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))
{

View File

@@ -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))
{

View File

@@ -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))
{

View File

@@ -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))
{