[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...
> it has added as the last line some garbage:
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
$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:
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.
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/
More information about the clipart