Bugfix sur l'affichage des photos

This commit is contained in:
Rodolphe Quiedeville 2005-03-11 08:22:27 +00:00
parent ffb9654b49
commit b33a50e6ee

View File

@ -891,19 +891,22 @@ class Product
$pdir = get_exdir($this->id) . $this->id ."/photos/";
$dir = $sdir . '/'. $pdir;
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
if ( file_exists($dir))
{
if (is_file($dir.$file))
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
$photo = $file;
if (is_file($dir.$file))
{
$photo = $file;
}
}
if (strlen($photo))
{
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$photo).'">';
}
}
if (strlen($photo))
{
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$photo).'">';
}
}
/**