[dev] IMP and html2text filter called from lib/MIME/Viewer/plain.php

Chris Stromsoe cbs at cts.ucla.edu
Mon Nov 19 04:04:14 UTC 2007


On Sat, 17 Nov 2007, Chuck Hagenbuch wrote:

> What about putting a theoretically high but hopefully still useful for 
> performance limit on the length of the protocol? Something like:
>
>     |([\w+]{1,20})://([^\s"<]*[\w+#?/&=])|e
>
> (so, between 1 and 20 characters for the protocol string). It could 
> probably be a bit less if it makes a big difference.

That looks like it works ok.  The + inside the [\w+] inside the regexp 
isn't necessary.  I changed it to

     |([\w]{1,20})://([^\s"<]*[\w+#?/&=])|e

I'm still not convinced that calling the plain text MIME viewer should be 
interpreting HTML when viewed inline (ie, calling with TEXT_HTML_MICRO 
instead of TEXT_HTML_NOHTML), but the change does work and the attachment 
loads and displays quickly.

Thanks.


-Chris


More information about the dev mailing list