Fix: bad path

Fix: view only image files
This commit is contained in:
Regis Houssin 2010-04-15 13:44:07 +00:00
parent 4ecaee9068
commit 163fba3872
2 changed files with 3 additions and 3 deletions

View File

@ -2510,7 +2510,7 @@ class Product extends CommonObject
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
if (dol_is_file($dir.$file))
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file))
{
$nbphoto++;
$photo = $file;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -209,7 +209,7 @@ if ($modulepart)
{
$accessallowed=1;
}
$original_file=(!empty($conf->produit->dir_temp)?$conf->produit->dir_temp:$conf->service->dir_temp).'/'.$original_file;
$original_file=(!empty($conf->produit->dir_output)?$conf->produit->dir_output:$conf->service->dir_output).'/'.$original_file;
}
// Wrapping for categories