diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 93b2ca25897..713ad9e527e 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -131,7 +131,10 @@ if ($facid > 0)
$i=0;
while (($file = readdir($handle))!==false)
{
- if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
+ if (! is_dir($dir.$file)
+ && ! eregi('^\.',$file)
+ && ! eregi('^CVS',$file)
+ && ! eregi('\.meta$',$file))
{
$filearray[$i]=$file;
$totalsize+=filesize($upload_dir."/".$file);
@@ -161,7 +164,7 @@ if ($facid > 0)
print '';
- if ($mesg) { print "$mesg
"; }
+ if ($mesg) { print $mesg."
"; }
// Affiche formulaire upload
if ($conf->global->MAIN_UPLOAD_DOC)
@@ -205,15 +208,17 @@ if ($facid > 0)
$var=true;
while (($file = readdir($handle))!==false)
{
- if (! is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS'
- && ! eregi('\.meta$',$file))
+ if (! is_dir($dir.$file)
+ && ! eregi('^\.',$file)
+ && ! eregi('^CVS',$file)
+ && ! eregi('\.meta$',$file))
{
$var=!$var;
print '