Page MenuHomePhabricator

Generated attribution HTML broken, shows mixed with encoded and decoded characters
Closed, ResolvedPublic

Description

How to reproduce:

  1. Open https://en.wikipedia.org/wiki/All-on-4#/media/File:Nobel_Biocare_All-on-4_solution_image_1.jpg
  2. Click on the Download icon "Download this file" in the bottom-right corner
  3. Click on "You need to attribute the author"
  4. Click on "HTML"
  5. See the generated HTML below, it is mixed with encoded and decoded characters
By &lt;a href=&quot;//commons.wikimedia.org/w/index.php?title=User:Nobel_Biocare&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Nobel Biocare (page does not exist)&quot;&gt;Nobel Biocare&lt;/a&gt; - &lt;span class=&quot;int-own-work&quot; lang=&quot;en&quot;&gt;Own work&lt;/span&gt;, <a href="https://creativecommons.org/licenses/by-sa/3.0" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a>, <a href="https://commons.wikimedia.org/w/index.php?curid=25125707">Link</a>

Produces:

Hhmg1mj.png (106×1 px, 28 KB)

Fix proposal:

By <a href="//commons.wikimedia.org/w/index.php?title=User:Nobel_Biocare&action=edit&redlink=1" class="new" title="User:Nobel Biocare (page does not exist)">Nobel Biocare</a> - <span class="int-own-work" lang="en">Own work</span>, <a href="https://creativecommons.org/licenses/by-sa/3.0" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a>, <a href="https://commons.wikimedia.org/w/index.php?curid=25125707">Link</a>

Would produce:

SOmj180SDQ.png (74×563 px, 6 KB)

Event Timeline

Aklapper renamed this task from BUG: Generated attribution HTML is shown mixed with encoded and decoded characters to Generated attribution HTML broken, shows mixed with encoded and decoded characters.Nov 4 2020, 6:59 PM
Aklapper added projects: MediaViewer, Regression.
Aklapper triaged this task as Low priority.Jul 14 2022, 9:51 AM

Change #1027518 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/extensions/MultimediaViewer@master] EmbedFileFormatter.getCreditHtml: do not escape author HTML

https://gerrit.wikimedia.org/r/1027518

Change #1027518 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] EmbedFileFormatter.getCreditHtml: do not escape author HTML

https://gerrit.wikimedia.org/r/1027518