Last modified: 2014-04-26 09:48:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39564, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37564 - <html> lang="" attribute should always be set to an invalid language code
<html> lang="" attribute should always be set to an invalid language code
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 21:33 UTC by Krinkle
Modified: 2014-04-26 09:48 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2012-06-13 21:33:37 UTC
Contrary to what we thought, this attribute is not set to the content language code, but to whatever the intended language code is.

If whatever preference (or uselang= query parameter value) is not of a supported language, the interface falls back to the default (English) but the value here does not.

See also:
* https://bugzilla.wikimedia.org/show_bug.cgi?id=5790#c26
* bug 36938 (which would almost be a non-issue if this bug was fixed, since valid language codes probably don't contain html special characters, but it doesn't hurt to escape it anyway)
* bug 24747

So urls like:
* https://en.wikipedia.org/wiki/Main_Page?uselang=a%27%20onmouseover
* https://en.wikipedia.org/wiki/Main_Page?uselang=krinkle

should have <html lang="en">
Comment 1 Fomafix 2012-06-18 10:51:07 UTC
Du you mean User interface language (https://www.mediawiki.org/wiki/Language_in_MediaWiki#User_interface_language) or Page content language (https://www.mediawiki.org/wiki/Language_in_MediaWiki#Page_content_language)? Please concretize the bug title.
Comment 2 Mark A. Hershberger 2012-09-28 18:57:07 UTC
shouldn't block release
Comment 3 Krinkle 2014-04-26 09:23:49 UTC
(In reply to Fomafix from comment #1)
> Du you mean User interface language
> (https://www.mediawiki.org/wiki/
> Language_in_MediaWiki#User_interface_language) or Page content language
> (https://www.mediawiki.org/wiki/
> Language_in_MediaWiki#Page_content_language)? Please concretize the bug
> title.

Irrelevant. This is about the language code used for the HTML document served by MediaWiki. It doesn't matter whether that is a wiki user or wiki content language code.
Comment 4 Krinkle 2014-04-26 09:30:09 UTC
(In reply to Krinkle from comment #0)
> So urls like:
> * https://en.wikipedia.org/wiki/Main_Page?uselang=a%27%20onmouseover
> * https://en.wikipedia.org/wiki/Main_Page?uselang=krinkle
> 
> should have <html lang="en">

The first one now has <html lang="en">.

The latter doesn't, but that seems to be in intentional hack in MediaWiki for the purpose of allowing {{int:}} hack customisation.

See implementation of Language::isValidCode, which explicitly doesn't check whether a language exists, in order to allow {{int:}} hacks such as historically used on Wikimedia Commons to provide an extra dimension of interface customisation:

- https://commons.wikimedia.org/w/index.php?title=Special:Upload&uselang=ownwork
- https://commons.wikimedia.org/w/index.php?title=Special:Upload&uselang=fromflickr
- https://commons.wikimedia.org/w/index.php?title=Special:Upload&uselang=fromgov

So until we decide do no longer support that, it makes sense to have this consistently reflected throughout and not make a weird exception just for <html lang> but not anywhere else.
Comment 5 Liangent 2014-04-26 09:48:57 UTC
The new summary, ".. should always be set to an invalid .." ?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links