You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
911 B
38 lines
911 B
<?php |
|
if (!isset($_GET['e'])) { |
|
header('HTTP/1.1 400 Bad Request'); |
|
die(); |
|
} |
|
$extension = substr($_GET['e'], 0, 64); |
|
if (!ctype_alpha($extension)) { |
|
header('HTTP/1.1 400 Bad Request'); |
|
die(); |
|
} |
|
|
|
require('../constants.php'); |
|
$filename = FRESHRSS_PATH . '/extensions/' . $extension . '/'; |
|
|
|
if (isset($_GET['j'])) { |
|
header('Content-Type: application/javascript; charset=UTF-8'); |
|
header('Content-Disposition: inline; filename="script.js"'); |
|
$filename .= 'script.js'; |
|
} elseif (isset($_GET['c'])) { |
|
header('Content-Type: text/css; charset=UTF-8'); |
|
header('Content-Disposition: inline; filename="style.css"'); |
|
$filename .= 'style.css'; |
|
} else { |
|
header('HTTP/1.1 400 Bad Request'); |
|
die(); |
|
} |
|
|
|
$mtime = @filemtime($filename); |
|
if ($mtime == false) { |
|
header('HTTP/1.1 404 Not Found'); |
|
die(); |
|
} |
|
|
|
require(LIB_PATH . '/http-conditional.php'); |
|
|
|
if (!httpConditional($mtime, 604800, 2)) { |
|
readfile($filename); |
|
}
|
|
|