Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-59248

Page name translations do not save properly when the name contains an ampersand (&) and certain xml system properties are set

    Details

      Description

      DESCRIPTION
      After setting the properties below in the JVM arguments, page names with the ampersand sign (&) will get truncated.

      The system properties:
      javax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl
      javax.xml.stream.XMLOutputFactory=com.sun.xml.internal.stream.XMLOutputFactoryImpl

      STEPS TO REPRODUCE

      1. Get a new bundle of Liferay 6.1.30 (tomcat is fine)
      2. Add these lines to the JVM arguments in tomcat/bin/setenv.sh:
        • -Djavax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl
        • -Djavax.xml.stream.XMLOutputFactory=com.sun.xml.internal.stream.XMLOutputFactoryImpl
      3. Startup Liferay
      4. Add a new page
      5. Add a translation to the page with an ampersand in the name: 'test&test'
      6. Save the page

      Notes
      Per Eric Chin,

      See here for my fix: https://gist.github.com/ericchin/ecf0046386cef4e62b76#file-localizationimpl-java-L22-L33

      The fix from LPS-14852 was made to com.liferay.portal.util.LocalizationImpl#getLocalization. I would like to have the same fix for com.liferay.portal.util.LocalizationImpl#_copyNonExempt

      Issue is related to this blog post: https://www.liferay.com/web/igor.spasic/blog/-/blogs/careful-with-the-xmlstreamreader-gettext-!

        Attachments

        1. Fixed.gif
          Fixed.gif
          271 kB
        2. Fixed61.gif
          Fixed61.gif
          410 kB
        3. Fixed62.gif
          Fixed62.gif
          356 kB
        4. Reproduced.gif
          Reproduced.gif
          387 kB

          Issue Links

            Activity

              People

              Assignee:
              harry.chai Harry Chai
              Reporter:
              eric.yan Eric Yan
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 46 weeks, 5 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.X EE
                  7.0.0 Alpha 2