From 1c524efbf7da91cb99bb4516feb514071e938495 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 10 Jul 2022 01:30:05 +0300 Subject: dark theme support --- htdocs/sass.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'htdocs/sass.php') diff --git a/htdocs/sass.php b/htdocs/sass.php index eb24962..186b706 100644 --- a/htdocs/sass.php +++ b/htdocs/sass.php @@ -4,7 +4,14 @@ require __DIR__.'/../init.php'; global $config; $name = $_REQUEST['name'] ?? ''; -if (!$config['is_dev'] || !$name || !file_exists($path = ROOT.'/htdocs/scss/'.$name.'.scss')) { +$theme = $_REQUEST['theme'] ?? ''; + +if ($theme != 'light' && $theme != 'dark') { + http_response_code(403); + exit; +} + +if (!$config['is_dev'] || !$name || !file_exists($path = ROOT.'/htdocs/scss/entries/'.$name.'/'.$theme.'.scss')) { // logError(__FILE__.': access denied'); http_response_code(403); exit; -- cgit v1.2.3