thumb: show 404.png for missing requests
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 4 Jul 2018 16:56:08 +0000 (18:56 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 11:42:39 +0000 (13:42 +0200)
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";