Add sjdict.com

This commit is contained in:
John Alanbrook 2022-11-15 22:45:33 +00:00
parent 506d2605ba
commit 17e95b6d99

View file

@ -20,8 +20,6 @@ if (preg_match('/\.(?:jpg|png|webp|css|ico|js|ttf|woff|txt)/', $_SERVER["REQUEST
return false; return false;
} }
load_page($tryuri); load_page($tryuri);
@ -80,12 +78,11 @@ function uri_from_file($file) {
} }
function try_file($uri, $ext) { function try_file($uri, $ext) {
$tryuri = ltrim($uri, '/');
$tryf = "$uri/index"; $tryf = ltrim("$tryuri/index", '/');
$tryuri = ltrim($tryf, '/');
if (is_file("$tryf.$ext")) return "$tryf.$ext"; 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";
} }