Page MenuHomePhabricator

upload.js doesn't respect $wgStrictFileExtensions
Closed, ResolvedPublic

Description

Author: ms419

Description:
Previously, by disabling $wgStrictFileExtensions, I could upload files with extensions that are not among the "preferred extensions"

Since upgrading MediaWiki, I can no longer upload files with extensions that are not among the "preferred extensions"

upload.js, roughly line 245, refuses to upload these files - even if $wgStrictFileExtensions is disabled


Version: 1.17.x
Severity: minor

Details

Reference
bz24022

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:09 PM
bzimport set Reference to bz24022.
bzimport added a subscriber: Unknown Object (MLST).

We could easily fix this by exposing wgStrictFileExtensions on the upload page, but that doesn't seem like a good idea to me. Someone might go around looking for mediawiki sites where he can upload arbitrary files.

Wouldn't it be best if we retooled all this into a single ajax call ?

one that checks for:
-name exists
-name allowed (file extensions checks)
-name normalization (think $wgCapitalizedNamespaces)

Bryan.TongMinh wrote:

(In reply to comment #1)

We could easily fix this by exposing wgStrictFileExtensions on the upload page,
but that doesn't seem like a good idea to me. Someone might go around looking
for mediawiki sites where he can upload arbitrary files.

I don't think it is that much of a problem; you could also try it out by uploading a file.

Wouldn't it be best if we retooled all this into a single ajax call ?

one that checks for:
-name exists
-name allowed (file extensions checks)
-name normalization (think $wgCapitalizedNamespaces)

If somebody would implement that, yes, that would be ideal. But for now exposing wgStrictFileExtensions could be used as quick fix.