Better handling for language in profiles

git-svn-id: https://svn.libreccm.org/ccm/trunk@4973 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2017-09-01 11:49:17 +00:00
parent aaead492e1
commit ce1f4aa3e2
1 changed files with 12 additions and 1 deletions

View File

@ -81,6 +81,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import com.arsdigita.cms.ReusableImageAsset;
import com.arsdigita.kernel.KernelConfig;
/**
* Servlet for the PublicPersonalProfile application.
@ -117,7 +118,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
if (CMSConfig.getInstanceOf().getUseLanguageExtension()) {
final String pathInfo = request.getPathInfo();
if (!pathInfo.matches("(.*)/index\\.[a-zA-Z]{2}")) {
final String lang;
String lang;
if (GlobalizationHelper.getSelectedLocale(request) == null) {
lang = GlobalizationHelper
.getNegotiatedLocale()
@ -128,6 +129,16 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
.getLanguage();
}
final Path path = new Path(getPath(request));
final PublicPersonalProfile profile = getProfile(SessionManager.getSession(),
path.getProfileOwner(),
path.getPreview(),
lang);
if (profile == null) {
lang = KernelConfig.getConfig().getDefaultLanguage();
}
final StringBuffer redirectTo = new StringBuffer();
if (DispatcherHelper.getWebappContext() != null