[wp-trac] [WordPress Trac] #5252: base64-encoded post-by-email post garbled.

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 24 08:58:20 GMT 2007


#5252: base64-encoded post-by-email post garbled.
-----------------------+----------------------------------------------------
 Reporter:  kallewoof  |       Owner:  anonymous
     Type:  defect     |      Status:  new      
 Priority:  normal     |   Milestone:  2.5      
Component:  General    |     Version:  2.3      
 Severity:  normal     |    Keywords:           
-----------------------+----------------------------------------------------
 When posting-by-email, my cellphone submits code using "content-transfer-
 encoding: base64". The message appears (output from wp-mail.php) like so:

 Author = [my email] <p><p><b>Content-type:</b> text/plain, <b>Content-
 Transfer-Encoding:</b> base64, <b>boundary:</b> </p>
 <p><b>Raw content:</b><br
 /><pre>SnVzdCB0ZXN0aW5nIHBvc3RpbmcgZnJvbSBteSBjZWxsLiBTdHJ1Y2sgbWUgd2hpbGUgcmVh
 ZGluZyAgUmFwaCBLb3N0ZXIncyBwb3N0cyBhYm91dCB0aGUgZmlyZXMgaW4gQ2FsIHRoYXQg
 YmVpbmcgYWJsZSB0byBwb3N0IHRvIHlvdXIgYmxvZyBmcm9tIGEgY2VsbHBob25lIGlzIGEg
 dXNlZnVsIGZlYXR1cmUuIA==</pre></p>
 <p><b>Author:</b> 1</p>
 <p><b>Posted title:</b> =?utf-8?B?Q2VsbHBob25lIHBvc3RpbmcgaW4gV1A=?=<br />
 <b>Posted content:</b><br
 /><pre>SnVzdCB0ZXN0aW5nIHBvc3RpbmcgZnJvbSBteSBjZWxsLiBTdHJ1Y2sgbWUgd2hpbGUgcmVh
 ZGluZyAgUmFwaCBLb3N0ZXIncyBwb3N0cyBhYm91dCB0aGUgZmlyZXMgaW4gQ2FsIHRoYXQg
 YmVpbmcgYWJsZSB0byBwb3N0IHRvIHlvdXIgYmxvZyBmcm9tIGEgY2VsbHBob25lIGlzIGEg
 dXNlZnVsIGZlYXR1cmUuIA==</pre></p><p>Mission complete, message
 <strong>1</strong> deleted.</p>

 The provided patch detects base64-encoded content transfers and
 base64_decodes them. For some reason (I'm no utf8-expert) the TITLE of the
 post has "=?utf-8?B?" prepended to the actual base64 content (see above),
 which means a check for this string + a cropping is needed or
 base64_decode will not decode the post title properly.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5252>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list