]> 91.132.146.200 Git - selfpaste.git/commitdiff
added something to display images
authorBanana <johannes.kessler@bechtle.com>
Mon, 26 Jul 2021 14:50:52 +0000 (16:50 +0200)
committerBanana <johannes.kessler@bechtle.com>
Mon, 26 Jul 2021 14:50:52 +0000 (16:50 +0200)
webroot/index.php

index 2f252e7378d2e4ae89fe0a60d8e4bceef956f085..c18d715ff6a6e1c405c19efec0583219ff78b352 100644 (file)
@@ -79,6 +79,14 @@ if(!empty($_short)) {
     $_requestFile .= $_p;
     $_requestFile .= $_t;
     if(is_readable($_requestFile)) {
+
+       $finfo = finfo_open(FILEINFO_MIME_TYPE);
+        $mime = finfo_file($finfo, $_requestFile);
+        finfo_close($finfo);
+        if(strstr($mime,'image/')) {
+            $contentType = "Content-type: $mime;";
+        }
+
         $contentBody = $_requestFile;
         $httpResponseCode = 200;
     }