Closed Bug 1521693 Opened 6 years ago Closed 6 years ago

Redirect creation from the editor does not work when target page's title starts with <

Categories

(developer.mozilla.org Graveyard :: Editing, enhancement, P1)

All
Other
enhancement

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sphinx_knight, Assigned: dflanagan+bugzilla)

Details

(Keywords: in-triage, Whiteboard: [specification][type:bug])

What did you do?

  1. Opened a page to edit  it
  2. Used the editor UI button to create a redirect to https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function

What happened?

The created content was just "<p>REDIRECT</p>" (no link)

What should have happened?

A "normal" redirect should have been created by adding the following content in the document:

<p>REDIRECT <a class="redirect" href="/en-US/docs/Web/CSS/timing-function"><timing-function></a></p>

Actually, I don't really care if "<" and ">" are escaped in the text do the expected result could (to me) be:

<p>REDIRECT <a class="redirect" href="/en-US/docs/Web/CSS/timing-function">timing-function</a></p>

Is there anything else we should know?

I've created test pages:
A. https://developer.mozilla.org/fr/docs/User:SphinxKnight/middle%3Cbracket (title "middle<bracket")

B. https://developer.mozilla.org/fr/docs/User:SphinxKnight/%3Cleftbracket (title "<leftbracket")

C. https://developer.mozilla.org/fr/docs/User:SphinxKnight/rightbracket%3E (title "rightbracket>")

The redirect "edition" works both for B and C. The text content of the <a> element is stripped from whatever comes after "<".

Bug created after https://bugzilla.mozilla.org/show_bug.cgi?id=1520413

Keywords: in-triage
Priority: -- → P1
Assignee: nobody → djf
Status: NEW → ASSIGNED

A fix is ready for review here: https://github.com/mozilla/kuma/pull/5247

Thanks Julien for pointing directly to the plugin file that needed to be fixed. That made this fix super-easy.

This has been deployed. The HTML inserted is now properly escaped:

<p>REDIRECT <a class="redirect" href="/en-US/docs/Web/CSS/timing-function">&lt;timing-function&gt;</a></p>
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

Verified indeed :) thanks!

Status: RESOLVED → VERIFIED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.