[imp] $conf['mailformat']['brokenrfc2231'] doesnt work, bug in Part.php

Jan Schneider jan at horde.org
Sat Jun 13 14:37:50 UTC 2009


Zitat von Harakiri <harakiri_23 at yahoo.com>:

>
> The workaround for the option brokenrfc2231 doesnt work, for longer  
> filenames at least (>50?).
>
> The check (strpos($encode_2231, '*=') !== false)) will never return  
> true, simply because
>
> $encode_2231 = MIME::encodeRFC2231($key, $value, $charset);
>
> will not result in *= but in *0= *1= etc - an encoded string looks like this:
>
> name*0="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
> 	name*1="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
> 	name*2="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
> 	name*3="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.pdf"
>
> there is no name*= for longer filenames. Only for shorter
>
> Fix:
>
> replace if with
>
> if (!empty($GLOBALS['conf']['mailformat']['brokenrfc2231']) &&
>                 ((strpos($encode_2231, '*=') !== false) ||  
> (strpos($encode_2231, '*0=') !== false))) {
>                 $ctype .= '; ' . $key . '="' . MIME::encode($value,  
> $charset) . '"';
>             }
>
> in both places
>
>
>
>
>
> --
> IMP mailing list - Join the hunt: http://horde.org/bounties/#imp
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
>


Please create a ticket on http://bugs.horde.org/.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.horde.org/archives/imp/attachments/20090613/62187623/attachment.bin>


More information about the imp mailing list