Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-6201

Forcing multi-lingual mode to use one of the configured languages doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Trivial
    • 3.2 M3
    • 3.2 M2
    • Old Core
    • None
    • patch
    • Trivial

    Description

      I noticed an instance where the java.lang.String.split method clearly has been confused with org.apache.commons.lang.StringUtils.split:

      --- src/main/java/com/xpn/xwiki/XWiki.java      (revision 36199)
      +++ src/main/java/com/xpn/xwiki/XWiki.java      (working copy)
      @@ -2519,7 +2519,7 @@
                       List<String> acceptedLanguages = getAcceptedLanguages(context.getRequest());
                       // We can force one of the configured languages to be accepted
                       if (Param("xwiki.language.forceSupported", "0").equals("1")) {
      -                    List<String> available = Arrays.asList(getXWikiPreference("languages", context).split(", |"));
      +                    List<String> available = Arrays.asList(getXWikiPreference("languages", context).split("[, |]"));
                           // Filter only configured languages
                           acceptedLanguages.retainAll(available);
                       }
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            aj Andreas Jonsson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: