[dev] backslash in subject being "expanded"?

Michael M Slusarz slusarz at mail.curecanti.org
Sun Feb 12 17:26:13 PST 2006


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Marc Jauvin <marc at r4l.com>:
>
>> OK, I found it in "framework/MIME/MIME.php":
>>
>>      function decode($string, $to_charset = null)
>>      {
>>          return stripslashes(MIME::_decode($string, $to_charset));
>>      }
>>
>> MIME::decode() is being called in imp/mailbox.php (in particular) to
>> decode the subject of the emails.
>>
>> As a test, I've removed the stripslashes() call and it fixes my
>> problem. but am thinking it must have been put there for a reason...
>>
>> Anybody knows a good reason for this?
>
> The only thing I can think of offhand is escaped characters in email
> addresses. But that shouldn't be the case for all headers. Here's the
> commit where it was added:
>
> http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.154&r2=1.155&ty=h
>
> No bug id, so... Michael? I'm going to revert this for now.

Yes, reverting is correct.  This is a RFC 2822 (mail headers) issue  
instead of a RFC 2047 (MIME) issue so I fixed it in the wrong place.   
I've made the correct fixed in IMP's mailbox.php - this is a display  
issue so the slashes should only come off right before we display  
anything to the user.

michael

_______________________________________
Michael Slusarz [slusarz at curecanti.org]


More information about the dev mailing list