page: strip html suffix from symlink redirects
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 12 Aug 2018 16:00:53 +0000 (18:00 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 17 Aug 2018 13:08:51 +0000 (15:08 +0200)
page.php

index 070742643481a29ad0a818a6173841e690b7fdfd..8979e6298d0d7c7d45a961264af9ce5a84182685 100644 (file)
--- a/page.php
+++ b/page.php
@@ -137,7 +137,7 @@ $staticpage = NULL;
 if (file_exists("$Page$Args.html")) {
        $staticpage = "$Page$Args.html";
        if (is_link($staticpage)) {
-               $target = readlink($staticpage);
+               $target = preg_replace('/\.html$/', '', readlink($staticpage));
                header("HTTP/1.1 302 Shorthand");
                header("Location: $target");
                exit;