mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
TALOS-2023-1881
CVE-2023-49738
This commit is contained in:
parent
2792f538ce
commit
fb2372b191
2 changed files with 10 additions and 1 deletions
|
@ -70,6 +70,12 @@ if(ImagesPlaceHolders::isDefaultImage($file)){
|
|||
}else{
|
||||
header("HTTP/1.0 200 OK");
|
||||
}
|
||||
|
||||
$imageInfo = getimagesize($file);
|
||||
if (empty($imageInfo)) {
|
||||
die('not image');
|
||||
}
|
||||
|
||||
header('Content-Type:' . $type);
|
||||
header('Content-Length: ' . filesize($file));
|
||||
readfile($file);
|
||||
|
|
|
@ -10,9 +10,12 @@ if($imageURL == 'favicon.ico'){
|
|||
}
|
||||
|
||||
if (file_exists($imgLocalFile)) {
|
||||
$imageInfo = getimagesize($imgLocalFile);
|
||||
if (empty($imageInfo)) {
|
||||
die('not image');
|
||||
}
|
||||
// Determine the content type based on the file extension
|
||||
$fileExtension = strtolower(pathinfo($imgLocalFile, PATHINFO_EXTENSION));
|
||||
|
||||
switch ($fileExtension) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue