thumb: show 404.png for missing requests
[minimedit.git] / thumb / index.php
index e8b3bcb0e5b18cfc782f6278f08ffb829016e412..f7c36d9d0a6d776bde1a4ff3008b2f401958e770 100644 (file)
@@ -7,7 +7,10 @@ $imgpath = preg_replace('{^(?=[0-9]+/)}', 'data/', $imgpath, 1);
 
 if (!file_exists($imgpath)) {
        http_response_code(404);
-       exit;
+       $imgpath = '404.png';
+       if (!file_exists($imgpath)) {
+               exit;
+       }
 }
 
 $target = "thumb/$height/$imgpath";