diff options
Diffstat (limited to '_site/rewrites/assets.php')
-rw-r--r-- | _site/rewrites/assets.php | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/_site/rewrites/assets.php b/_site/rewrites/assets.php index bd2baac..8ee7a38 100644 --- a/_site/rewrites/assets.php +++ b/_site/rewrites/assets.php @@ -1,25 +1,25 @@ -<?php - -if (!isset($_GET['i'])) { - die(); -} - -if (strpos($_GET['i'], ".") !== false && strpos($_GET['i'], "\\") !== false) { - die(); -} - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/../_posts/assets/" . $_GET['i']) || !is_file($_SERVER['DOCUMENT_ROOT'] . "/../_posts/assets/" . $_GET['i'])) { - die(); -} - -$file = $_SERVER['DOCUMENT_ROOT'] . "/../_posts/assets/" . $_GET['i']; - -header('Content-Type: ' . mime_content_type($file)); -header('Content-Transfer-Encoding: binary'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); -ob_clean(); -flush(); -readfile($file); +<?php
+
+if (!isset($_GET['i'])) {
+ die();
+}
+
+if (strpos($_GET['i'], ".") !== false && strpos($_GET['i'], "\\") !== false) {
+ die();
+}
+
+if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/../_posts/assets/" . $_GET['i']) || !is_file($_SERVER['DOCUMENT_ROOT'] . "/../_posts/assets/" . $_GET['i'])) {
+ die();
+}
+
+$file = $_SERVER['DOCUMENT_ROOT'] . "/../_posts/assets/" . $_GET['i'];
+
+header('Content-Type: ' . mime_content_type($file));
+header('Content-Transfer-Encoding: binary');
+header('Expires: 0');
+header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+header('Pragma: public');
+ob_clean();
+flush();
+readfile($file);
exit;
\ No newline at end of file |