Page MenuHomePhabricator

Media type for JavaScript is hard-coded, and should not be
Closed, ResolvedPublic

Description

Author: n-roeser

Description:
Currently, the MediaWiki software uses a hard-coded media type (MIME type) of
'text/javascript' for all scripts in the JavaScript language. No type of this
name has been registered with IANA by now, and some users probably want to use a
more correct type of, for example, 'application/x-javascript' until this issue
is resolved.
The attached patch adds the ability to configure the media type which shall be
used for scripts in the JavaScript language. This is a good idea as work on
getting media types for this language registered has already begun. The default
value set by this patch is 'text/javascript'; users can override it in
LocalSettings.php as usual.
The patch is for 1.4.3 or the REL1_4 branch (will work on both at the moment).
It will not apply cleanly to CVS HEAD.


Version: 1.5.x
Severity: minor

Details

Reference
bz2064

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:26 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz2064.
bzimport added a subscriber: Unknown Object (MLST).

n-roeser wrote:

JS media type patch against mediawiki-1.4.3

attachment mediawiki-1.4.3-jsmimetype-1.patch ignored as obsolete

Thank you, W3C, for using non-assigned types as the only examples in your HTML specification
documentation. :P

avarab wrote:

The diff fails on HEAD (works on REL1_4). It's probably unwise to add this to
REL1_4 (closed for features)

$ patch -p1 < patch
patching file includes/DefaultSettings.php
Hunk #1 succeeded at 374 with fuzz 1 (offset 35 lines).
patching file includes/EditPage.php
Hunk #1 succeeded at 923 (offset 173 lines).
Hunk #2 succeeded at 1015 (offset 173 lines).
patching file includes/RawPage.php
Hunk #1 succeeded at 20 (offset 3 lines).
patching file includes/Skin.php
Hunk #1 FAILED at 202.
Hunk #2 FAILED at 2121.
2 out of 2 hunks FAILED -- saving rejects to file includes/Skin.php.rej
patching file includes/SkinTemplate.php
Hunk #1 succeeded at 145 with fuzz 2.
Hunk #2 succeeded at 218 (offset 6 lines).
Hunk #3 FAILED at 861.
Hunk #4 succeeded at 907 (offset 44 lines).
1 out of 4 hunks FAILED -- saving rejects to file includes/SkinTemplate.php.rej
patching file skins/MonoBook.php
Hunk #1 succeeded at 61 with fuzz 1 (offset 8 lines).
Hunk #2 succeeded at 122 (offset 9 lines).
patching file skins/Standard.php
patching file skins/disabled/Amethyst.pt
patching file skins/disabled/Chick.pt
patching file skins/disabled/MonoBook.pt
can't find file to patch at input line 258
Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

diff -Naur mediawiki-1.4.3/skins/disabled/Wikimania.php

mediawiki-1.4.3-jsmimetype/skins/disabled/Wikimania.php

--- mediawiki-1.4.3/skins/disabled/Wikimania.php 2005-04-03

18:24:25.000000000 +0000

+++ mediawiki-1.4.3-jsmimetype/skins/disabled/Wikimania.php 2005-05-03

16:51:04.000000000 +0000

File to patch: skins/disabled/Wikimania.php
skins/disabled/Wikimania.php: No such file or directory
Skip this patch? [y] y
Skipping patch.
2 out of 2 hunks ignored
patching file skins/disabled/WikimediaWiki.pt

n-roeser wrote:

Patch against CVS HEAD as of 2005-05-04T10:33:08+0200

This patch applies cleanly against CVS HEAD as of a few seconds ago.

attachment mediawiki-HEAD_20050504T103308+0200-jsmimetype-1.patch ignored as obsolete

n-roeser wrote:

Fixed version of patch for HEAD branch

Sorry, the previous patch had bugs in it: there were a few '$' characters
missing due to a copy-and-paste error. I created this fixed version by
inserting them into the patch file.

Attached:

avarab wrote:

Applied to HEAD, thanks for the patch.

epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:24 AM
epriestley added a commit: Unknown Object (Diffusion Commit).