HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/css.php
<?php

// if the site is down for maintenacne we still want to show css as the admin will still use it
// so ignore the down for maintenanace message for this page load
define('IGNORE_MAINTENANCE', true);
define('IGNORE_INSTALL', true);
define('IN_CONTROL_PANEL', true);

require_once(dirname(__FILE__) . '/api/iwp.php');

IWP::Init('basic,outputbuffer,language,functions');

$file = preg_replace('/[^a-zA-Z0-9\-_ \.,]/', '', @$_GET['f']);
$module = preg_replace('/[^a-zA-Z0-9\-_ \.,]/', '', @$_GET['m']);

if (strlen($file) < 0 || strlen($module) < 0) {
	header("HTTP/1.0 404 Not Found", true, 404);
	header("Status: 404 Not Found");
	die();
}

$path = IWP_BASE_PATH . '/modules/' . $module . '/templates/';
$ext = 'css';

if (!file_exists($path . $file . '.' . $ext)) {
	header("HTTP/1.0 404 Not Found", true, 404);
	header("Status: 404 Not Found");
	die();
}

$template = iwp_template::getInstance();

header('Content-Type: text/css');

function GetModuleImagePath ($imageName) {
	global $module;

	if (file_exists(IWP_BASE_PATH . '/templates/' . iwp_config::Get('template') . '/modules/' . $module . '/images/' . $imageName)) {
		return iwp_config::Get('appPath') . 'templates/' . iwp_config::Get('template') . '/modules/' . $module . '/images/' . $imageName;
	}

	return iwp_config::Get('appPath') . 'modules/' . $module . '/images/' . $imageName;
}

$template->SetTemplatePath($path);
$template->SetIncludePath(IWP_BASE_PATH);
$template->SetCachePath(IWP_CACHE_TEMPLATE_PATH);

function SendCacheHeaders ($LastModifiedDate) {
	if ($LastModifiedDate) {
		$date = gmdate("D, d M Y H:i:s \G\M\T",$LastModifiedDate);

		if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $LastModifiedDate)) {
			if (php_sapi_name() == 'CGI') {
				header("Status: 304 Not Modified");

			} else {
				header("HTTP/1.0 304 Not Modified");
			}

			header('Last-Modified: '.$date);
			header('Cache-Control: max-age=604800, must-revalidate');
			header("Pragma: public");
			header('Expires: '.gmdate("D, d M Y H:i:s \G\M\T",time()+604800));
			die();
		} else {

			header('Last-Modified: '.$date);
			header('Cache-Control: max-age=604800, must-revalidate');
			header("Pragma: public");
			header('Expires: '.gmdate("D, d M Y H:i:s \G\M\T",time()+604800));
		}
	}
}

SendCacheHeaders(filemtime($path . $file . '.' . $ext));
$contents = @file_get_contents($path . $file . '.' . $ext);
echo $template->ParseInput($contents);