From b99d3a70ae0b489f272cab31f282ce3ff62c5dff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 May 2012 00:05:08 +0200 Subject: [PATCH] Revert "Fix: Return empty image instead of error when file not found." This reverts commit b266a19300b2275d8e733407c02d20fca92fd507. --- htdocs/viewimage.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index dc30fd53483..83c0b3852e9 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -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); }