gwynne                                   Wed, 02 Dec 2009 13:56:50 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=291593

Log:
Limit subject to 500 instead of 900. Quick hack that should guarantee correct 
encoding in all non-pathological cases.

Changed paths:
    U   SVNROOT/commit-email.php

Modified: SVNROOT/commit-email.php
===================================================================
--- SVNROOT/commit-email.php    2009-12-02 13:44:32 UTC (rev 291592)
+++ SVNROOT/commit-email.php    2009-12-02 13:56:50 UTC (rev 291593)
@@ -166,13 +166,13 @@
 function utf8_safe_header($header_value)
 {
     // As per experience and 
http://www.php.net/manual/en/function.imap-8bit.php#75081
-    // 1 - Limit string to 900 chars, giving some slop for the replacements 
and extensions
+    // 1 - Limit string to 500 chars, giving a really huge slop for the 
replacements and extensions
     // 2 - imap_8bit() the string
     // 3 - Replace =\r\n with nothing, _ with =5F, and ? with =3F
     // 6 - Replace <space> with _
     // 7 - Surround with =?utf-8?q??=
     return '=?utf-8?q?' . str_replace(' ', '_', str_replace(array('_', 
"=\r\n", '?'), array('=5F', '', '=3F'),
-        imap_8bit(substr($header_value, 0, 900)))) . '?=';
+        imap_8bit(substr($header_value, 0, 500)))) . '?=';
 }

 // 
-----------------------------------------------------------------------------------------------------------------------------

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to