Andreas Sachs created WW-5422:
---------------------------------

             Summary: I18nInterceptor and invalide locale
                 Key: WW-5422
                 URL: https://issues.apache.org/jira/browse/WW-5422
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions: 6.3.0
            Reporter: Andreas Sachs


Exception if locale contains trimable characters:

 

Eg Request: 

request_locale=de%0A

 

Code from I18nInterceptor line 187:

 
{code:java}
if (localeProvider.isValidLocaleString(localeStr)) {
locale = LocaleUtils.toLocale(localeStr);
}{code}
 

isValidLocaleString returns true because localeStr is trimmed inside function (
locale = LocaleUtils.toLocale(StringUtils.trimToNull(localeStr)) )
 
but LocaleUtils.toLocale(localeStr) will throw an exception afterwards.
 

 

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to