Skip to content

Commit f09e0b8

Browse files
committed
Resolve calls when the root app is not the core
1 parent bf79774 commit f09e0b8

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

wcfsetup/install/files/lib/system/WCF.class.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,22 @@ protected function resolveActiveApplication(): void
495495
$prefix = \mb_substr($app->domainPath, \mb_strlen($rootApp->domainPath));
496496
RouteHandler::ltrimPathInfo($prefix);
497497
} else {
498-
\wcfDebug(RouteHandler::getPath(), $pathInfo);
498+
// The path info is relative to the root app, therefore we need to
499+
// resolve the invoked app by examining the start of it.
500+
$lengthOfRootPath = \mb_strlen($rootApp->domainPath);
501+
foreach ($sortedPaths as $packageID => $pathname) {
502+
$pathname = \mb_substr($pathname, $lengthOfRootPath);
503+
if (\str_starts_with($pathInfo, $pathname)) {
504+
$candidate = $packageID;
505+
506+
// Trim the path info to strip the invoekd app from it.
507+
RouteHandler::ltrimPathInfo($pathname);
508+
509+
break;
510+
}
511+
}
512+
513+
\assert($candidate !== null);
499514
}
500515

501516
if ($candidate === null) {

0 commit comments

Comments
 (0)