diff --git a/composer.json b/composer.json index 5efc9e0..0bd6d47 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "rakibtg/sleekdb": "2.15", "ext-http": "*", "ext-mbstring" : "*", - "ext-zip": "*" + "ext-zip": "*", + "ext-fileinfo": "*" } } \ No newline at end of file diff --git a/interface.php b/interface.php index 3f6095b..0d54229 100644 --- a/interface.php +++ b/interface.php @@ -286,9 +286,12 @@ function patch_through_image(string $gameid, string $img_url) $image_fetch_url = $game_dir . DIRECTORY_SEPARATOR . $img_url; $img_fp = fopen($image_fetch_url, "r"); + $content_type = mime_content_type($image_fetch_url); if ($img_fp === false) { $img_fp = fopen(MISSING_IMAGE_PLACEHOLDER, "r"); + $content_type = mime_content_type(MISSING_IMAGE_PLACEHOLDER); } + header("Content-Type: $content_type"); fpassthru($img_fp); fclose($img_fp); }