- Image patch through Content-Type adjusting added
This commit is contained in:
parent
821f31cd10
commit
e2140d8dee
@ -3,6 +3,7 @@
|
||||
"rakibtg/sleekdb": "2.15",
|
||||
"ext-http": "*",
|
||||
"ext-mbstring" : "*",
|
||||
"ext-zip": "*"
|
||||
"ext-zip": "*",
|
||||
"ext-fileinfo": "*"
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user