Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz1037933 - locale length validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Dec 23, 2013
1 parent cd51a16 commit 7af8fd5
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -49,6 +49,7 @@
@Restrict("#{s:hasRole('admin')}")
public class LanguageManagerAction implements Serializable {
private static final long serialVersionUID = 1L;
private static final int LENGTH_LIMIT = 254;

@In
private LocaleDAO localeDAO;
Expand Down Expand Up @@ -172,6 +173,13 @@ public boolean isLanguageNameValid() {
this.languageNameValidationMessage = null; // reset
this.languageNameWarningMessage = null; // reset

if (language.length() > LENGTH_LIMIT) {
this.uLocale = null;
this.languageNameValidationMessage =
messages.get("jsf.language.validation.Invalid");
return false;
}

// Cannot use FacesMessages as they are request scoped.
// Cannot use UI binding as they don't work in Page scoped beans
// TODO Use the new (since 1.7) FlashScopeBean
Expand Down

0 comments on commit 7af8fd5

Please sign in to comment.