HEX
Server: LiteSpeed
System: Linux cde2.duelhost.dk 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: dtptviut (1121)
PHP: 8.0.30
Disabled: exec,system,passthru,shell_exec,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/dtptviut/domains/morsunivers.dk/public_html/wp-content/plugins/external-images/ssl-proxy.php
<?php
if (empty($_GET['img'])) // Check if $_GET['img'] is not set AND is = '' (empty)
{
    exit;
}
$image_url = $_GET['img'];
ini_set('gd.jpeg_ignore_warning', true);

if (stripos($image_url, '.jpg') !== false) {
	$imagetype = 'image/jpeg';
} else if (stripos($image_url, '.jpeg') !== false) {
	$imagetype = 'image/jpeg';
} else if (stripos($image_url, '.png') !== false) {
	$imagetype = 'image/png';
} else if (stripos($image_url, '.gif') !== false) {
	$imagetype = 'image/gif';
} else { 
	$checkmime = getimagesize($image_url);
	if ($checkmime) {
		$imagetype = $checkmime['mime'];
	}
}
if (empty($imagetype)) {
	die("We couldn't load the image file type. Either this is an invalid image, or your php.ini settings on your server needs the allow_url_fopen = On setting (instead of Off)");
	
}
if($imagetype != 'image/png' && $imagetype != 'image/gif' && $imagetype != 'image/jpeg') {
	echo "failed to get image type";
	die('not supported');
} else {
	/*
	echo "ready to try outputting image";
	var_dump(ini_get('allow_url_fopen'));
	exit;

	$file = @ fopen($image_url, 'rb');
	echo print_r($file, true);
	exit;

	header('Content-Type: ' . $imagetype);
	header( 'Cache-Control: max-age=604800' );
	if ($file) {
		fpassthru($file);
		exit;
	}
	*/
	header('Content-Type: ' . $imagetype);
	header( 'Cache-Control: max-age=604800' );
	ob_clean();
	readfile($image_url);
/*	ob_clean();
	readfile($image_url);
*/
}