From 31ebbb4464acc3ec554e56b6026166549b389f3d Mon Sep 17 00:00:00 2001 From: administrateur Date: Fri, 26 Mar 2021 13:47:57 +0100 Subject: [PATCH] fix: history problem, mime type errors --- index.php | 13 +++++++++---- js/functions.js | 9 ++++++++- lib/functions.php | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 07aa690..dd75fba 100644 --- a/index.php +++ b/index.php @@ -101,8 +101,11 @@ else if (isset($_POST['action'])) if (substr($file,0,1)==":") specialurl($file,true); else - print(getcontent($file,true,true)); + { + $md=strpos('.md',$file)>=0; + print(getcontent($file,$md,true)); exit; + } case 'realopen': $file=urldecode($_POST['file']); print(getcontent($file,false,true)); @@ -139,8 +142,9 @@ else if ($filedetail['extension']!="" && strpos(ALLOWED_EXT, $filedetail['extens { if (file_exists(CONTENT_DIR . $file)) { - if ($filedetail['extension']=="css") header("Content-type: text/css"); - print file_get_contents(CONTENT_DIR . $file); + header('Content-type: '.mime_content_type(CONTENT_DIR . $file),true); + print file_get_contents(CONTENT_DIR . $file, false); + exit; } else { @@ -157,7 +161,7 @@ else -<?php echo TITLE; ?> +<title><?php echo TITLE." - ".$file; ?> @@ -169,6 +173,7 @@ else ':''); ?> +