Kawai Wiki

Compare Revisions

Ignore whitespace Rev 228 → Rev 229

/trunk/src/main/java/org/kawai/action/PageAction.java
12,7 → 12,6
import org.mentawai.filter.AuthenticationFree;
import org.mentawai.rule.MethodRule;
import org.mentawai.rule.RegexRule;
import org.mentawai.util.HttpUtils;
import org.mentawai.validation.Validatable;
import org.mentawai.validation.ValidationInterceptor;
import org.mentawai.validation.Validator;
328,11 → 327,15
}
if (isPrettyURL()) {
boolean wrongLanguage = !language.getLocale().equals(getLocale()); // cookies do not match with parameter
// check if URL is complete with the correct title...
String correctTitle = page.getPrettyURLFormattedTitle();
String inputTitle = input.getString("title");
if (inputTitle == null || !inputTitle.equals(correctTitle)) {
String prettyURL = getPrettyURL("Page", null, name, correctTitle);
if (inputTitle == null || !inputTitle.equals(correctTitle) || wrongLanguage) {
String prettyURL = getPrettyURL("Page", null, name, language.getLocale().toString(), correctTitle);
if (wrongLanguage) prettyURL += "?lang=" + language.getLocale().toString(); // adjust cookies to adjust flags...
redir(prettyURL);
return SHOW;
}