Author: dodgy
Description:
when adding a link to an external image from a domain that is allowed ( via http://www.mediawiki.org/wiki/Manual:$wgAllowExternalImages or http://www.mediawiki.org/wiki/Manual:$wgAllowExternalImagesFrom or http://www.mediawiki.org/wiki/Manual:$wgEnableImageWhitelist ), files with extension gif|png|jpg|jpeg result in the image being inlined, but this is not the case for SVG files.
The following fixes this:
in \includes\parser\Parser.php, line 91, 92:
const EXT_IMAGE_REGEX = '/^(http:\/\/|https:\/\/)([^][<>"\\x00-\\x20\\x7F\p{Zs}]+)
\\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg)$/Sxu';
change that to :
const EXT_IMAGE_REGEX = '/^(http:\/\/|https:\/\/)([^][<>"\\x00-\\x20\\x7F\p{Zs}]+)
\\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg|svg)$/Sxu';
Note the simple addition of svg.
I have done so myself in mediawiki 1.22.5, and this allows SVGs to be visible on the page, in Chrome 33.0.1750.154 m
Version: 1.22.5
Severity: normal