[Clipart] files damaged at upload - again

Jonadab the Unsightly One jonadab at bright.net
Mon Oct 4 07:23:01 PDT 2004


Nicu Buculei <nicu at apsro.com> writes:

> i know that is an old bug already discussed, but i found another
> file damaged in the upload process:

I'm investigating this again...

> http://www.openclipart.org/incoming/paramedic_cross_01.svg
> it has added as the last line some garbage:
> "-----------------------------1957747793424238335719885386--"

This looks very much to me like a content separator, something
CGI::Lite is not cleaning out and should be (or else, something a
browser is inserting and shouldn't be).  Before, I had asked about
just removing everything after the closing </svg> tag in order to
solve this, but I was told that it's valid for comments or RDF to be
after the closing </svg> tag.

Now it has occurred to me that comments or RDF metadata will start
with the character < whereas the above doesn't.  So I'm proposing
this:

      $img =~ s|(?<=</svg>)[^<]*||s;

That should greatly reduce the incidence of this bug.  It doesn't
actually completely fix it, as there is always the vague possibility
that the junk at the end might contain a less-than symbol, but to my
knowledge it hasn't in the cases we've seen, so at minimum we should
see the bug much less often with this change.

If my reasoning is flawed and we shouldn't clean out junk after </svg>
that doesn't start with < then someone should speak up before I do a
cvs commit (tomorrow probably).

> we have old similar cases:
> http://www.openclipart.org/incoming/paramedic_cross_01.svg
> http://www.openclipart.org/incoming/red_flower_03.svg
> http://www.openclipart.org/incoming/otto_needs_you_01.svg
> http://www.openclipart.org/incoming/gnu_01.svg
> http://www.openclipart.org/incoming/failed/etiquettelaptop_01.svg
> http://www.openclipart.org/incoming/failed/flourish_three_lower_left_corner_01.svg
> http://www.openclipart.org/incoming/failed/flourish_three_upper_right_corner_01.svg

I was going to grab these old ones and clean them up and re-upload
them, so as to not leave them hanging forever, but they no longer
appear to be there.

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




More information about the clipart mailing list