Fix broken links on help page
What does this MR do?
This merge request updates the regular expression in the help controller that
prefixes relative links with /help/
.
The controller needs to differentiate between
- relative links which should be prefixed by
/help/
and - external links which should be used as-is.
The old regular expression used a faulty look-ahead pattern which treats
relative links that appear before an external link on the same line as an external
link. These links are then not prefixed with /help/
and thus point to a
non-existing page.
The new implementation uses a stricter look-ahead pattern following RFC 3896. The new implementation treads relative and external links on the same line correctly.
Furthermore, the new implementation is aware of the following three edge-cases:
- Links which do not include
//
, e.g.mailto:mail@example.com
, are treated as external links and are not prefixed with/help/
(unlike old implementation). -
Protocol-relative links, such as
//example.com/
, are treated as external links and are not prefixed with/help/
(same as old implementation). - Relative links with
https://
in the query part of the URL, such ashelp_page?go=https://example.com/
are treated as relative links and prefixed with/help/
(unlike old implementation).
Test cases have been added to check the listed scenarios.
What are the relevant issue numbers?
#49729 (closed), #57554 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Closes #57554 (closed)