From 17e95b6d998ae3d3627823202371730dd1dd7f5c Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Tue, 15 Nov 2022 22:45:33 +0000 Subject: [PATCH] Add sjdict.com --- router.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/router.php b/router.php index 2f4644a..dd67aa5 100644 --- a/router.php +++ b/router.php @@ -20,8 +20,6 @@ if (preg_match('/\.(?:jpg|png|webp|css|ico|js|ttf|woff|txt)/', $_SERVER["REQUEST return false; } - - load_page($tryuri); @@ -80,12 +78,11 @@ function uri_from_file($file) { } function try_file($uri, $ext) { - - $tryf = "$uri/index"; - $tryuri = ltrim($tryf, '/'); + $tryuri = ltrim($uri, '/'); + $tryf = ltrim("$tryuri/index", '/'); if (is_file("$tryf.$ext")) return "$tryf.$ext"; - else if (is_file("$uri.$ext")) return "$uri.$ext"; + else if (is_file("$tryuri.$ext")) return "$tryuri.$ext"; }