Page MenuHomePhabricator

Create captions button in video.js player breaks if the filename contains special characters (?,%)
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue

  • Upload a video file to Commons that contains a special character (?,%,&)
  • Visit the File page (or otherwise invoke the video player)
  • Click the CC (Closed Captions) icon to pull up the menu
  • Select "create captions"
  • A new window/tab will open for TimedText
  • The message "There is no video associated with the current subtitle page." appears instead of the interface to add captions

Example: https://meta.wikimedia.org/wiki/File:Does_the_content_on_Wikipedia_reflect_the_world’s_diversity%3F_–_A_WIKI_MINUTE.webm

What happens?:

Since the file name contains a character that is escaped, such as a question mark, that is escaped to "%3F". MediaWiki sees that as a differently named file (or the link is just broken in transit) and does not load the correct URL.

What should have happened instead?:
The menu item should link to the escaped version of the URL.

This should load: https://commons.wikimedia.org/wiki/TimedText:Does_the_content_on_Wikipedia_reflect_the_world’s_diversity%3F_–_A_WIKI_MINUTE.webm

Not this: https://commons.wikimedia.org/wiki/TimedText:Does_the_content_on_Wikipedia_reflect_the_world’s_diversity?_–_A_WIKI_MINUTE.webm

Note: This feature was added in this commit: https://phabricator.wikimedia.org/rETMH194bb4165e65563409d44772d06c0bf854c19e28

Event Timeline

Change 927262 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/TimedMediaHandler@master] Use encodeURIComponent for create captions link

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

Change 927262 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Use encodeURIComponent for create captions link

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

TheDJ claimed this task.