Page MenuHomePhabricator

make file extension for external images configurable
Open, LowestPublicFeature

Description

currently, the file extensions that cause an external link to be rendered as an image if $wgAllowExternalImages is true is hardcoded in Parser::EXT_IMAGE_REGEX. It would be much nicer if it was derived from $wgFileExtensions. Not all allowed file extensions are images, but the ones that are can be identified using MimeMagic::guessTypesForExtension($mime) and MimeMagic::findMediaType($mime).


Version: 1.18.x
Severity: enhancement

Details

Reference
bz28491

Event Timeline

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

I'm not sure there's not much benefit to using $wgFileExtensions; $wgFileExtensions controls what you can locally upload so that it can be verified, managed, rendered into thumbnails, etc. None of that happens with external images -- they're just put into an <img> so there's no interpretation or rendering that would depend on the file type.

We don't even get a chance to control the image's size... :(

I'd actually rather drop $wgAllowExternalImages entirely and replace it, if it's needed, with a smarter way of dealing with externally sourced images; guessing imageness from URLs has never been safe or complete to begin with.

Legit use of externally-referenced images is probably better off being done as some sort of extension that lets you explicitly size, place, and caption them.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM
Aklapper removed a subscriber: wikibugs-l-list.