@nathank’s report focused on the specific niche thing they happened to be doing when they encountered the bug. However, the bug is in no way specific to Data Explorer. I fear the overly narrow focus of the report, and the use of the irrelevant data-explorer tag (the appropriate tag would be composer), might result in it being difficult for the Discourse team to interpret, or in it not being given the appropriate level of attention.
The fault occurs universally under the following conditions:
- The URL contains percent-encoded content
- The link is added to the post via the “Insert link” dialog.
The URL is always corrupted under these conditions.
Reproducible steps:
- Open the following URL in your web browser:
https://en.wikipedia.org/wiki/Horncastle_boar%27s_head
(note that the URL contains the'
character’s percent-encoding%27
)
The expected page opens.
- Click the “Link” icon on the post composer.
The “Insert link” dialog will open. - Enter the above URL in the “Link or topic” field of the dialog.
- Click the “Insert” button.
The target of the link added through the above procedure is the incorrect:
https://en.wikipedia.org/wiki/Horncastle_boar%2527s_head
instead of the correct URL:
https://en.wikipedia.org/wiki/Horncastle_boar%27s_head
The link will not lead to the intended page.
This happened because the %
character of the percent encoding %27
was encoded redundantly, causing the %
to be replaced by its own percent-encoding %25
, resulting in the correct URL content %27
being corrupted to %2527
Platform:
Operating System
- Windows 11
Browser
- Google Chrome 139.0.7258.128
Discourse
12c80d43adeb87cc18604ace0430a75d277d7662
Additional context:
I am able to reproduce the fault on try.discourse.org in “safe mode”.
The fault occurs in either composer mode.