[MGNLUI-3795] Node names from content apps that contain ~ (tilde) might cause trouble when used in URL (e.g. categories) Created: 02/Mar/16  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: content app
Affects Version/s: 5.4.4
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Philip Mundt Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PAGES-60 Page node names that contain ~ (tilde... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When e.g. a category contains a ~ in its node name and when it's used in the website in an URI (by means of selector parameter, see info.magnolia.cms.core.Path#SELECTOR_DELIMITER) then the node will not be resolvable, because the tilde will be removed.

How to reproduce

  1. Goto STK demo and open categories app
  2. Rename a category (e.g. Finance to Finance~) using the ~ character, activate changes
  3. Open localhost:8080/magnoliaPublic/demo-project/service/category~Finance~~.html
  4. Error will show that category cannot be found

Source

The ~ (tilde) is a reserved character due to being used as selector delimiter (see info.magnolia.cms.core.Path#SELECTOR_DELIMITER).

Considered solutions

  • prevent entering the ~ as part of a page name e.g. by validation or
  • always sanitize the path (by replacing tilde with e.g. dash) upon storage.
  • support both selector or node-name when there's no ambiguity (and specify who should win otherwise)


 Comments   
Comment by Roman Kovařík [ 08/Mar/21 ]

Looks like ~ is escaped in the latest https://demo.magnolia-cms.com/.magnolia/admincentral#app:pages-app:browser;/travel/

Generated at Mon Feb 12 09:10:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.