[Clipart] files damaged at upload - again
nicu at apsro.com
Tue Oct 12 02:46:52 PDT 2004
Jonadab the Unsightly One wrote:
> 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.
i have another test case for you:
this time the junk at the end of the file is only "--"
More information about the clipart