From d701fd8b143023a5cc4ded5d5374ead710115f24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Dec 2004 17:03:20 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Utilisation=20du=20wrapper=20s=E9curis?= =?UTF-8?q?=E9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 24 +++++++++++++----------- htdocs/compta/facture/apercu.php | 27 +++++++++++++++------------ htdocs/compta/paiement/rapport.php | 2 +- htdocs/compta/prelevement/index.php | 16 ++++++---------- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 53f3df239a8..59fd805d51a 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1205,19 +1205,22 @@ else $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $facref = str_replace($forbidden_chars,"_",$fac->ref); $file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf"; - - print "
"; + $filedetail = $conf->facture->dir_output . "/" . $facref . "/" . $facref . "-detail.pdf"; + $relativepath = "${facref}/${facref}.pdf"; + $relativepathdetail = "${facref}/${facref}-detail.pdf"; + + $var=true; + + print "
"; if (file_exists($file)) { - $encfile = urlencode($file); print_titre("Documents"); print ''; - print ""; - - print ''; + print ""; + print ''; print ''; print ''; print ''; @@ -1230,12 +1233,11 @@ else { if (is_readable($dir.$file) && substr($file, -10) == 'detail.pdf') { - $encfile = urlencode($dir.$file); - print ""; + print ""; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; } } diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 62e00b5927a..67f8532e115 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -129,23 +129,27 @@ if ($_GET["facid"] > 0) * Documents * */ - $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); - $facref = str_replace($forbidden_chars,"_",$fac->ref); - $file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf"; - $filedetail = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . "-detail.pdf"; - $fileimage = $file.".png"; + $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); + $facref = str_replace($forbidden_chars,"_",$fac->ref); + $file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf"; + $filedetail = $conf->facture->dir_output . "/" . $facref . "/" . $facref . "-detail.pdf"; + $relativepath = "${facref}/${facref}.pdf"; + $relativepathdetail = "${facref}/${facref}-detail.pdf"; + + $fileimage = $file.".png"; - // Si fichier PDF existe + $var=true; + + // Si fichier PDF existe if (file_exists($file)) { $encfile = urlencode($file); print_titre("Documents"); print '
Facture PDF'.$fac->ref.'.pdf
".$langs->trans("Bill")." PDF'.$fac->ref.'.pdf'.filesize($file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'
Facture détaillée
Facture détaillée'.$fac->ref.'-detail.pdf'.filesize($dir.$file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($dir.$file)).''.$fac->ref.'-detail.pdf'.filesize($filedetail). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'
'; - print ""; - - print ''; + print ""; + print ''; print ''; print ''; print ''; @@ -153,10 +157,9 @@ if ($_GET["facid"] > 0) // Si fichier detail PDF existe if (file_exists($filedetail)) // facture détaillée supplémentaire { - $encfile = urlencode($filedetail); - print ""; + print ""; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index e6de71740ae..0ddc47b3a54 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -146,7 +146,7 @@ if ($year) $var=!$var; $tfile = $dir . '/'.$year.'/'.$file; $relativepath = $year.'/'.$file; - print "".''; + print "".''; print ''; print ''; } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 54f80080360..6e21ee19d41 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -32,9 +32,6 @@ require_once DOL_DOCUMENT_ROOT."/includes/modules/modPrelevement.class.php"; $user->getrights('banque'); -$mod = new modPrelevement($db); -$dir = $mod->data_directory; - llxHeader(); print_titre($langs->trans("Bons de prélèvements")); @@ -47,17 +44,16 @@ print ''; print ''; print "\n"; -$handle=opendir($dir); + +$dir = $conf->prelevement->dir_output; +$handle=opendir($dir."/bon"); while (($file = readdir($handle))!==false) { - if (is_readable($dir.$file) && is_file($dir.$file)) + $relativepath="/bon/".$file; + if (is_readable($dir."/".$relativepath) && is_file($dir."/".$relativepath)) { - print ''; } }
".$langs->trans("Bill")." PDF'.$fac->ref.'.pdf
".$langs->trans("Bill")." PDF'.$fac->ref.'.pdf'.filesize($file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'
Facture détaillée
Facture détaillée'.$fac->ref.'-detail.pdf'.$fac->ref.'-detail.pdf'.filesize($filedetail). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'
'.img_pdf().' '.$file.'
'.img_pdf().' '.$file.''.filesize($tfile). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($tfile)).'
'.$langs->trans("Date").' 
'.$file.''; - - - - + print '
'.$file.''; print '