[ https://issues.apache.org/jira/browse/WW-5422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Sachs updated WW-5422: ------------------------------ Summary: I18nInterceptor and invalid locale (was: I18nInterceptor and invalide locale) > I18nInterceptor and invalid 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 > Priority: Minor > > 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)