Qual: Utilisation de la fonction sanitize_string pour nettoyer les noms des fichiers gnrs des caractres spciaux.
This commit is contained in:
parent
1335980da7
commit
506a5de072
@ -144,8 +144,7 @@ if ($_POST['action'] == 'send')
|
||||
$propal= new Propal($db);
|
||||
if ( $propal->fetch($_POST['propalid']) )
|
||||
{
|
||||
$forbidden_chars=array('/','\\',':','*','?','"','<','>','|','[',']',',',';','=');
|
||||
$propalref = str_replace($forbidden_chars,'_',$propal->ref);
|
||||
$propalref = sanitize_string($propal->ref);
|
||||
$file = $conf->propal->dir_output . '/' . $propalref . '/' . $propalref . '.pdf';
|
||||
if (is_readable($file))
|
||||
{
|
||||
@ -811,8 +810,7 @@ if ($_GET['propalid'])
|
||||
{
|
||||
if ($user->rights->propale->envoyer)
|
||||
{
|
||||
$forbidden_chars=array('/','\\',':','*','?','"','<','>','|','[',']',',',';','=');
|
||||
$propref = str_replace($forbidden_chars,'_',$obj->ref);
|
||||
$propref = sanitize_string($obj->ref);
|
||||
$file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
||||
if (file_exists($file))
|
||||
{
|
||||
@ -856,8 +854,7 @@ if ($_GET['propalid'])
|
||||
print_titre($langs->trans('Documents'));
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
$forbidden_chars=array('/','\\',':','*','?','"','<','>','|','[',']',',',';','=');
|
||||
$propref = str_replace($forbidden_chars,'_',$propal->ref);
|
||||
$propref = sanitize_string($propal->ref);
|
||||
$file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
||||
$relativepath = $propref.'/'.$propref.'.pdf';
|
||||
|
||||
|
||||
@ -73,8 +73,7 @@ if ($propalid > 0)
|
||||
|
||||
if ($propal->fetch($propalid))
|
||||
{
|
||||
$forbidden_chars=array('/','\\',':','*','?','"','<','>','|','[',']',',',';','=');
|
||||
$propref = str_replace($forbidden_chars, '_', $propal->ref);
|
||||
$propref = sanitize_string($propal->ref);
|
||||
$upload_dir = $conf->propal->dir_output.'/'.$propref;
|
||||
if ( $error_msg )
|
||||
{
|
||||
|
||||
@ -354,8 +354,7 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance')
|
||||
$fac = new Facture($db,"",$_POST["facid"]);
|
||||
if ( $fac->fetch($_POST["facid"]) )
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
||||
|
||||
if (is_readable($file))
|
||||
@ -1325,8 +1324,7 @@ else
|
||||
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse
|
||||
*/
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
||||
$relativepath = "${facref}/${facref}.pdf";
|
||||
|
||||
|
||||
@ -147,8 +147,7 @@ if ($_GET["facid"] > 0)
|
||||
* Documents
|
||||
*
|
||||
*/
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
||||
$filedetail = $conf->facture->dir_output . "/" . $facref . "/" . $facref . "-detail.pdf";
|
||||
$relativepath = "${facref}/${facref}.pdf";
|
||||
|
||||
@ -300,8 +300,7 @@ class FactureRec
|
||||
/*
|
||||
* Notify
|
||||
*/
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$this->ref);
|
||||
$facref = sanitize_string($this->ref);
|
||||
$filepdf = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
||||
|
||||
|
||||
|
||||
@ -455,8 +455,7 @@ if ($_GET["propalid"])
|
||||
print_titre($langs->trans('Documents'));
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
$forbidden_chars=array('/','\\',':','*','?','"','<','>','|','[',']',',',';','=');
|
||||
$propref = str_replace($forbidden_chars,'_',$propal->ref);
|
||||
$propref = sanitize_string($propal->ref);
|
||||
$file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
||||
$relativepath = $propref.'/'.$propref.'.pdf';
|
||||
|
||||
|
||||
@ -782,8 +782,7 @@ class Facture
|
||||
/*
|
||||
* Notify
|
||||
*/
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$this->ref);
|
||||
$facref = sanitize_string($this->ref);
|
||||
$filepdf = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
|
||||
|
||||
$mesg = "La facture ".$this->ref." a été validée.\n";
|
||||
|
||||
@ -155,8 +155,7 @@ function facture_meta_create($db, $facid, $message="")
|
||||
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($forbidden_chars,"_",$fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref ;
|
||||
$file = $dir . "/" . $facref . ".meta";
|
||||
|
||||
|
||||
@ -60,8 +60,7 @@ class pdf_adytek extends ModelePDFFactures {
|
||||
$fac = new Facture($this->db,"",$facid);
|
||||
$fac->fetch($facid);
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref;
|
||||
$file = $dir . "/" . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -57,8 +57,7 @@ class pdf_bernique extends ModelePDFFactures {
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref . "/" ;
|
||||
$file = $dir . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -55,8 +55,7 @@ class pdf_bigorneau extends ModelePDFFactures {
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref . "/" ;
|
||||
$file = $dir . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -59,8 +59,7 @@ class pdf_bulot extends ModelePDFFactures {
|
||||
$fac = new Facture($this->db,"",$facid);
|
||||
$fac->fetch($facid);
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref;
|
||||
$file = $dir . "/" . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -105,8 +105,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$fac = new Facture($this->db,"",$facid);
|
||||
$fac->fetch($facid);
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref;
|
||||
$file = $dir . "/" . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -106,8 +106,7 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$fac = new Facture($this->db,"",$facid);
|
||||
$fac->fetch($facid);
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref;
|
||||
$file = $dir . "/" . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -55,8 +55,7 @@ class pdf_tourteau extends ModelePDFFactures {
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$facref = str_replace($forbidden_chars,"_",$fac->ref);
|
||||
$facref = sanitize_string($fac->ref);
|
||||
$dir = $conf->facture->dir_output . "/" . $facref . "/" ;
|
||||
$file = $dir . $facref . ".pdf";
|
||||
|
||||
|
||||
@ -60,8 +60,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$fich = new Fichinter($this->db,"",$id);
|
||||
if ($fich->fetch($id))
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$fichref = str_replace($forbidden_chars,"_",$fich->ref);
|
||||
$fichref = sanitize_string($fich->ref);
|
||||
|
||||
$dir = $conf->fichinter->dir_output . "/" . $fichref;
|
||||
$file = $dir . "/" . $fichref . ".pdf";
|
||||
|
||||
@ -72,8 +72,7 @@ class pdf_propale_adytek extends ModelePDFPropales
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$dir = $conf->propal->dir_output . "/" . $propref ;
|
||||
|
||||
if (! file_exists($dir))
|
||||
@ -91,8 +90,7 @@ class pdf_propale_adytek extends ModelePDFPropales
|
||||
return 0;
|
||||
}
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$file = $dir . "/" . $propref . ".pdf";
|
||||
|
||||
if (file_exists($dir))
|
||||
|
||||
@ -116,8 +116,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$prop = new Propal($this->db,"",$id);
|
||||
$prop->fetch($id);
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$prop->ref);
|
||||
$propref = sanitize_string($prop->ref);
|
||||
$dir = $conf->propal->dir_output . "/" . $propref;
|
||||
$file = $dir . "/" . $propref . ".pdf";
|
||||
|
||||
|
||||
@ -72,8 +72,7 @@ class pdf_propale_bleu extends ModelePDFPropales
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$dir = $conf->propal->dir_output . "/" . $propref ;
|
||||
|
||||
if (! file_exists($dir))
|
||||
@ -91,8 +90,7 @@ class pdf_propale_bleu extends ModelePDFPropales
|
||||
return 0;
|
||||
}
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$file = $dir . "/" . $propref . ".pdf";
|
||||
|
||||
if (file_exists($dir))
|
||||
|
||||
@ -72,8 +72,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$dir = $conf->propal->dir_output . "/" . $propref ;
|
||||
if (! file_exists($dir))
|
||||
{
|
||||
@ -90,8 +89,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
return 0;
|
||||
}
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$file = $dir . "/" . $propref . ".pdf";
|
||||
|
||||
if (file_exists($dir))
|
||||
|
||||
@ -74,8 +74,7 @@ class pdf_propale_rouge extends ModelePDFPropales
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$dir = $conf->propal->dir_output . "/" . $propref ;
|
||||
|
||||
if (! file_exists($dir))
|
||||
@ -93,8 +92,7 @@ class pdf_propale_rouge extends ModelePDFPropales
|
||||
return 0;
|
||||
}
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$file = $dir . "/" . $propref . ".pdf";
|
||||
|
||||
if (file_exists($dir))
|
||||
|
||||
@ -72,8 +72,7 @@ class pdf_propale_vert extends ModelePDFPropales
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$dir = $conf->propal->dir_output . "/" . $propref ;
|
||||
if (! file_exists($dir))
|
||||
{
|
||||
@ -90,8 +89,7 @@ class pdf_propale_vert extends ModelePDFPropales
|
||||
return 0;
|
||||
}
|
||||
|
||||
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
$propref = str_replace($forbidden_chars,"_",$propale->ref);
|
||||
$propref = sanitize_string($propale->ref);
|
||||
$file = $dir . "/" . $propref . ".pdf";
|
||||
|
||||
if (file_exists($dir))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user