https://bugzilla.wikimedia.org/show_bug.cgi?id=63806

            Bug ID: 63806
           Summary: svg external image not placed in image tag
           Product: MediaWiki
           Version: 1.22.5
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Parser
          Assignee: [email protected]
          Reporter: [email protected]
       Web browser: ---
   Mobile Platform: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to