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

Web Content text validation fails to report a URL consisting of multiple group friendlyURLs as invalid



      The BaseTextExportImportProcessor.validateLayoutReferences method currently uses a while loop when parsing the URL for a group friendly URL. I do not understand why a while loop was added here. You should only need to parse either 0 or 1 segments that consist of a group friendly URL, so a while loop is completely unnecessary.

      Because it uses a while loop, the method will not throw an error if subsequent group friendly URLs are found. It will just keep parsing them, so you could have as many group friendly URLs as you want in your URL, and it would still be considered valid.

      Steps to Reproduce

      1. Start up Liferay on a fresh database and log in as the admin user.
      2. Navigate to Liferay > Content > Web Content > + (Add Button) > Basic Web Content.
      3. Give it a title (it doesn't matter what the title is).
      4. Switch the "Content" field to Code view.
      5. Paste the following HTML into the "Content" field:
        <p><span><a href="http://localhost:8080/web/guest/guest/guest/guest/guest">text</a></span></p>
      6. Click on the Submit button

      Expected result: An error would appear in the UI: "The content references a missing page." The web content article would not be added because "http://localhost:8080/web/guest/guest/guest/guest/guest" is not a valid URL.
      Actual result: The web content article is successfully added with no errors.

      Reproduced in
      master (3bec09301a5e7610b1ddfade873c18e38e8c2637)
      ee-7.0.x (5684fe68b3b0e0f5cc15e93488ded172582745d9)


          Issue Links



              • Assignee:
                steven.gao Steven Gao (Inactive)
                michael.bowerman Michael Bowerman (Inactive)
                Participants of an Issue:
                Recent user:
                Csaba Turcsan
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  3 years, 14 weeks, 4 days ago


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