Web browser: ---
            Bug ID: 59744
           Summary: Consider safely opitimizing embedded SVG icons in
                    MediaWiki core
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: General/Unknown
    Classification: Unclassified
   Mobile Platform: ---

We may want to consider safely optimizing embedded SVG icons.

Full background is available at bug 59234.

(Copied from bug 59234 comment 27)

This seems to have been fixed in file 5.04; however, PHP uses a bundled,
patched copy of the library that was only updated from 5.03 to 5.11 in

Running "git tag --contains 12cf930a403d" in php-src tells me that
affected versions of PHP were 5.3.10 and older, as well as 5.4.0.
Wikimedia runs 5.3.10 in production.

Here's a snippet of the diff:

--- file-5.03/magic/Magdir/sgml    2008-07-26 11:03:55.000000000 -0400
+++ file-5.04/magic/Magdir/sgml    2009-09-19 13:31:35.000000000 -0400
@@ -1,36 +1,59 @@

+# $File: sgml,v 1.24 2009/09/19 17:31:35 christos Exp $
 # Type:    SVG Vectorial Graphics
 # From:    Noel Torres <>
 0    string        \<?xml\ version="
 >15    string        >\0
->>23    search/400    \<svg            SVG Scalable Vector Graphics image
+>>19    search/4096    \<svg            SVG Scalable Vector Graphics image
 !:mime    image/svg+xml

Note that the start offset of the search for "<svg" was dropped from 23 to 19,
and the newer, shorter XML declaration was the following 22-character string:

<?xml version="1.0" ?>

So this problem could have been avoided by either adding a DOCTYPE or leaving
one more whitespace character in the right place.

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

Reply via email to