1) { header('Content-Type: text/plain'); http::head(403,'Forbidden'); exit; } $allow_types = array('png','jpg','jpeg','gif','css','js','swf','svg','html','xml','json','txt'); $vf = path::clean($_GET['vf']); $VF = path::real(DC_VAR.'/'.$vf); if ($VF === false || !is_file($VF) || !is_readable($VF)) { header('Content-Type: text/plain'); http::head(404,'Not Found'); exit; } if (!in_array(files::getExtension($VF),$allow_types)) { header('Content-Type: text/plain'); http::head(404,'Not Found'); exit; } http::$cache_max_age = 7 * 24 * 60 * 60; // One week cache for var files served by ?vf=… http::cache(array_merge(array($VF),get_included_files())); header('Content-Type: '.files::getMimeType($VF)); readfile($VF); exit;