Skip to content

Commit

Permalink
chore: include hotfix-17612 (#26141)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsolistorres committed Sep 17, 2023
1 parent 594c8df commit df4e9fc
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,14 @@ private Host resolveSite(final PageContext context, final HttpServletRequest req
if (null != hostId) {
return this.hostAPI.find(hostId, user, mode.respectAnonPerms);
}

final String siteName = (null == request.getParameter(Host.HOST_VELOCITY_VAR_NAME)) ?
request.getServerName() : request.getParameter(Host.HOST_VELOCITY_VAR_NAME);
Host site = this.hostWebAPI.resolveHostName(siteName, user, mode.respectAnonPerms);

Host site;
if(mode.isAdmin && request.getSession().getAttribute( com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID )!=null) {
site = this.hostAPI.find(request.getSession().getAttribute( com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID ).toString(), user, mode.respectAnonPerms);
} else {
final String siteName = (null == request.getParameter(Host.HOST_VELOCITY_VAR_NAME)) ?
request.getServerName() : request.getParameter(Host.HOST_VELOCITY_VAR_NAME);
site = this.hostWebAPI.resolveHostName(siteName, user, mode.respectAnonPerms);
}
return site;

Expand Down

0 comments on commit df4e9fc

Please sign in to comment.