[Clipart] upload script suggestion

Jonadab the Unsightly One jonadab at bright.net
Mon Mar 21 08:27:39 PST 2005


"Stephen Silver" <ocalocal at btinternet.com> writes:

> I wrote:
>
>> The following two files in the incoming folder can't be fixed:
>>
>>   stupa_christopher_fynn_01.svg
>>   endless-knot-border_chri_01.svg
>>
>> In both cases everything after the first <g> start tag appears
>> to have been stripped out by the upload script - nothing at all
>> remains of the image itself.
>
> This line from upload_svg.cgi is surely the culprit:
>
>   $img =~ s|<$_.*?</$_>||gs for 'metadata', 'rdf:RDF', 'rdf';
>
> This line can easily disembowel an SVG file.  

At first I thought you might be right, but that's a non-greedy match
there, so _theoretically_ it should only remove metadata and rdf
elements and their contents, nothing else.  I tend to think the
problem may be elsewhere.  The input logging I've put in place now
should help us diagnose it.

The bad thing about the input logging is that we'll need to keep an
eye on the size of the log file, because it could easily grow rather
large.  Periodically, we'll need to take a copy of the log file off
the server and empty out the one on the server.

The good thing is, it should be incredibly useful for debugging.

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/




More information about the clipart mailing list