Revert "Fix: Return empty image instead of error when file not found."

This reverts commit b266a19300.
This commit is contained in:
Laurent Destailleur 2012-05-30 00:05:08 +02:00
parent 18d24c3f78
commit b99d3a70ae

View File

@ -372,15 +372,15 @@ else // Open and return file
// Output files on browser
dol_syslog("viewimage.php return file $original_file content-type=$type");
$original_file_osencoded=dol_osencode($original_file);
// This test is to avoid error images when image is not available (for example thumbs).
if (! dol_is_file($original_file))
// This test if file exists should be useless. We keep it to find bug more easily
if (! dol_is_file($original_file_osencoded))
{
$original_file=DOL_DOCUMENT_ROOT.'/theme/common/nophoto.jpg';
/*$error='Error: File '.$_GET["file"].' does not exists or filesystems permissions are not allowed';
$error='Error: File '.$_GET["file"].' does not exists or filesystems permissions are not allowed';
dol_print_error(0,$error);
print $error;
exit;*/
exit;
}
// Les drois sont ok et fichier trouve
@ -395,7 +395,6 @@ else // Open and return file
header('Content-type: image/png');
}
$original_file_osencoded=dol_osencode($original_file);
readfile($original_file_osencoded);
}