Brion Vibber wrote:
While reviewing some other code, I went in and started ripping up some of the file type & validity checks in MediaWiki's upload system, as they've been driving me nuts for some time. One quick subproject was tossing in an XML well-formedness check for SVG files. For the curious, here's a report on the invalid files I encountered while testing this with files from Commons: http://meta.wikimedia.org/wiki/SVG_validity_checks
Did you use a program ? Is some code on svn? When checking uploads, i only reviewed if the beginning seemed like SVG.
Right now I only really care that we can pass it as well-formed XML and recognize it as SVG, but that's the sort of thing that's great to test. :D
How does it work with multibyte (UCS-2) svgs? Even when they're good, Mediawiki shows needles instead of the thumbnail. Most problems were with people manually editing SVGs and having them saved with a wrong encoding (without fixing/adding the <?xml), as well as some not too used ways of writing them, such as using <!DOCTYPEs that i wasn't handling at the time.