Type: Regression Bug
Affects Version/s: 7.0.X EE, Master
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
- Start up Liferay on a fresh database and log in as the admin user.
- Navigate to Liferay > Content > Web Content > + (Add Button) > Basic Web Content.
- Give it a title (it doesn't matter what the title is).
- Switch the "Content" field to Code view.
- Paste the following HTML into the "Content" field:
- 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.