Fixed chat routes being broken.

This commit is contained in:
flash 2023-09-11 20:36:20 +00:00
parent 67d9620037
commit 4322f2561c
2 changed files with 11 additions and 12 deletions

4
composer.lock generated
View file

@ -414,7 +414,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.flash.moe/flash/index.git", "url": "https://git.flash.moe/flash/index.git",
"reference": "405724ec3f9f9f2fb318c5a1d9db175e1b99c382" "reference": "f71f3fcf9eb916420f3e8217f99e616149aedc76"
}, },
"require": { "require": {
"ext-mbstring": "*", "ext-mbstring": "*",
@ -452,7 +452,7 @@
], ],
"description": "Composer package for the common library for my projects.", "description": "Composer package for the common library for my projects.",
"homepage": "https://railgun.sh/index", "homepage": "https://railgun.sh/index",
"time": "2023-09-11T20:08:15+00:00" "time": "2023-09-11T20:34:16+00:00"
}, },
{ {
"name": "flashwave/sasae", "name": "flashwave/sasae",

View file

@ -137,9 +137,7 @@ $mszLegacyPath = $mszLegacyPathPrefix . $mszRequestPath;
if(!empty($mszLegacyPath) && str_starts_with($mszLegacyPath, $mszLegacyPathPrefix)) { if(!empty($mszLegacyPath) && str_starts_with($mszLegacyPath, $mszLegacyPathPrefix)) {
$mszLegacyPathReal = realpath($mszLegacyPath); $mszLegacyPathReal = realpath($mszLegacyPath);
if($mszLegacyPath !== $mszLegacyPathReal && $mszLegacyPath !== $mszLegacyPathReal . '/') if($mszLegacyPath === $mszLegacyPathReal || $mszLegacyPath === $mszLegacyPathReal . '/') {
Template::throwError(404);
if(str_starts_with($mszRequestPath, '/manage') && !$msz->hasManageAccess()) if(str_starts_with($mszRequestPath, '/manage') && !$msz->hasManageAccess())
Template::throwError(403); Template::throwError(403);
@ -150,6 +148,7 @@ if(!empty($mszLegacyPath) && str_starts_with($mszLegacyPath, $mszLegacyPathPrefi
require_once $mszLegacyPath; require_once $mszLegacyPath;
return; return;
} }
}
} }
$router->dispatch($request); $router->dispatch($request);