File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
wcfsetup/install/files/lib/system Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments