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

Web Content throws Javascript errors when adding special characters in title or content

    Details

      Description

      Description:
      Adding special characters, such as the line separator character: (U+2028), causes javascript errors. This is due to how javascript utilizes this character.

      References:

      Users can insert these line separators, depending on the document editor that they use.
      For example, I was able to reproduce this using the pre-installed app called Pages on the macbook. To insert a line separator, simply press "Shift + Enter" instead of "Enter" when going to the next line.

      Steps to Reproduce:

      Errors in Title Field

      1. Navigate to Content > Web Content
      2. Click [+] > Basic Web Content
      3. Copy into the Title field:
        abc
123
        • If the string above does not work, generate a string with a line separator if your document editor uses (U+2028) for it's line separator.
      4. Click Save as Draft.
      5. Try to edit the article and open the browser console

      Errors in Content Field

      1. Navigate to Content > Web Content
      2. Click [+] > Basic Web Content
      3. Copy into the Content field:
        abc
123
        • If the string above does not work, generate a string with a line separator if your document editor uses (U+2028) for it's line separator.
      4. Click Save as Draft.
      5. Try to edit the article and open the browser console

      Steps to Reproduce (GIF)

      Expected Results: Edit article page loads with the proper title/content fields and no javascript errors.
      Actual Results: Cannot edit article (content no longer available) and javascript errors are logged.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 16 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP14
                  7.0.0 DXP SP3
                  7.0.3 CE GA4
                  7.0.X EE
                  Master