Page MenuHomePhabricator

[BUG] Captions freezes when user injects illegal language codes that MediaWiki doesn't support
Closed, ResolvedPublic

Description

I have cmn on my userpage. When I click the pen button, I get this because cmn is not available.

<div data-caption-languages="en,cmn,de,yue,zh" class="filepage-mediainfo-entitytermsview oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed oo-ui-pendingElement-pending">

Unsupported babelcodes should be ignored to avoid this I guess?

Event Timeline

@Aklapper This is not the same.

cmn is ISO 639-3 code for Mandarin Chinese, which I speak natively, but this code is not recognised by the captions feature. The same problem can occur for aaa (Ghotuo language) and so on.

It freezes at this state. The code I gave was from checking the html.

Jdforrester-WMF renamed this task from [BUG] captions freezes when babelcodes are not available to [BUG] Captions freezes when user injects illegal language codes that MediaWiki doesn't support.Jan 16 2019, 6:06 PM
Jdforrester-WMF claimed this task.

Change 484810 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/WikibaseMediaInfo@master] CaptionsPanel.getCaptionLanguagesList: Drop unknown languages

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

Change 484810 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] CaptionsPanel.getCaptionLanguagesList: Drop unknown languages

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

Ramsey-WMF subscribed.

Tested on production with cmn-0. Works.