aboutsummaryrefslogtreecommitdiff
path: root/htdocs/sass.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-10 01:30:05 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-10 23:53:02 +0300
commit1c524efbf7da91cb99bb4516feb514071e938495 (patch)
treee1fced0104749014db154f5d3b29881e705bfafc /htdocs/sass.php
parent8979719a1af4bc0712407db7f95704f645f261a3 (diff)
dark theme support
Diffstat (limited to 'htdocs/sass.php')
-rw-r--r--htdocs/sass.php9
1 files changed, 8 insertions, 1 deletions
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;