[ic] [interchange] Allow name="0" in Content-Disposition header.

Daniel Browning db at kavod.com
Sat Apr 2 21:03:07 UTC 2011


On Saturday 02 April 2011 11:57:32 am Mike Heins wrote:
> Quoting Jon Jensen (jon at endpoint.com):
> > Interesting. There's always someone who uses a "0" somewhere you
> > wouldn't expect. :)

Indeed. Reminds me of http://xkcd.com/327/

> > That will now tolerate an empty name string, because the regular
> > expression will happily match one:
> > 
> >     my($param)= $header{'Content-Disposition'}=~/ name="?([^\";]*)"?/;
> > 
> > Perhaps it'd be best to also check for length($param). What do you
> > think?

Good catch, Jon. RFC 2183 might be useful here, but that would require 
someone to read the RFC.  (Not it!) :)

> I think you can do:
> 
>      my($param)= $header{'Content-Disposition'}=~/ name="?([^\";]+)"?/;
> 
> and solve that.

I like that idea, Mike; let's go with that.
--
DB



More information about the interchange-users mailing list