summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-02-26 14:09:44 -0500
committerFreya Murphy <freya@freyacat.org>2026-02-26 14:09:44 -0500
commitbc2a1889a4eb337c11d5b8d8a453a6bf4a982965 (patch)
tree8c1e2676d1b28e5a8eab49a30dee03b3b4aef115 /src
parentdont forget to set webp background to lossless (diff)
downloadwebsite-bc2a1889a4eb337c11d5b8d8a453a6bf4a982965.tar.gz
website-bc2a1889a4eb337c11d5b8d8a453a6bf4a982965.tar.bz2
website-bc2a1889a4eb337c11d5b8d8a453a6bf4a982965.zip
fix .htc polyfill loading
Diffstat (limited to 'src')
-rw-r--r--src/web/lib/hooks.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/web/lib/hooks.php b/src/web/lib/hooks.php
index 70853e1..a688069 100644
--- a/src/web/lib/hooks.php
+++ b/src/web/lib/hooks.php
@@ -1,6 +1,20 @@
<?php /* Copyright (c) 2024 Freya Murphy */
+function load_htc(string $file) {
+ $file_path = PUBLIC_ROOT . '/polyfills/' . $file;
+ if (!file_exists($file_path))
+ return;
+
+ header('Content-type: text/x-component');
+ include($file_path);
+ CRIMSON_DIE();
+}
+
function CRIMSON_pre_route_hook(Router $router): void {
+ $uri_str = ROUTER->req['uri_str'] ?? '';
+ $file = basename($uri_str);
+ if (str_ends_with($file, '.htc'))
+ load_htc($file);
}
function CRIMSON_error_hook(?array $req, int $code): never {