Fixed this thing being a layer up too high.

This commit is contained in:
flash 2025-04-03 19:42:43 +00:00
parent 83068a4183
commit 155b301405
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E

View file

@ -38,26 +38,26 @@ if($msz->routingCtx->domainRoles->hasRole($request->getHeaderLine('Host'), 'main
if(str_starts_with($mszLegacyPath, $mszLegacyPathPrefix)) {
$mszLegacyPathReal = realpath($mszLegacyPath);
if($mszLegacyPath === $mszLegacyPathReal || $mszLegacyPath === $mszLegacyPathReal . '/') {
// this is here so filters can run...
$msz->routingCtx->router->route(RouteInfo::exact(
$request->method,
$request->requestTarget,
#[Before('authz:cookie')]
function() use ($msz, $mszRequestPath) {
if(str_starts_with($mszRequestPath, 'manage') && !$msz->hasManageAccess())
return 403;
},
));
$response = $msz->routingCtx->router->handle($request);
if($response->getBody()->getSize() > 0) {
Router::output($response);
exit;
}
if(is_dir($mszLegacyPath))
$mszLegacyPath .= '/index.php';
if(is_file($mszLegacyPath)) {
// this is here so filters can run...
$msz->routingCtx->router->route(RouteInfo::exact(
$request->method,
$request->requestTarget,
#[Before('authz:cookie')]
function() use ($msz, $mszRequestPath) {
if(str_starts_with($mszRequestPath, 'manage') && !$msz->hasManageAccess())
return 403;
},
));
$response = $msz->routingCtx->router->handle($request);
if($response->getBody()->getSize() > 0) {
Router::output($response);
exit;
}
// Reconstruct $_POST since PHP no longer makes it for us
if($request->getBody()->isReadable() && empty($_POST)) {
$mszRequestContent = (function($contentType, $stream) {