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 // Output files on browser
dol_syslog("viewimage.php return file $original_file content-type=$type"); 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). // This test if file exists should be useless. We keep it to find bug more easily
if (! dol_is_file($original_file)) 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); dol_print_error(0,$error);
print $error; print $error;
exit;*/ exit;
} }
// Les drois sont ok et fichier trouve // Les drois sont ok et fichier trouve
@ -395,7 +395,6 @@ else // Open and return file
header('Content-type: image/png'); header('Content-type: image/png');
} }
$original_file_osencoded=dol_osencode($original_file);
readfile($original_file_osencoded); readfile($original_file_osencoded);
} }