diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-08-13 22:12:14 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-08-13 22:12:14 +0200 |
commit | bf73e037d63e15728160b545531eaf7948dc4092 (patch) | |
tree | aa86a7da730cb1fc4031c47d1ac6f90b3ce0f119 | |
parent | 51fcb01f0a86d148b470571c7e32dd089c9b090b (diff) |
Add fix for http://pear.php.net/bugs/bug.php?id=18819
-rw-r--r-- | program/lib/Net/SMTP.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/program/lib/Net/SMTP.php b/program/lib/Net/SMTP.php index 0463758b3..f780d60ec 100644 --- a/program/lib/Net/SMTP.php +++ b/program/lib/Net/SMTP.php @@ -936,14 +936,12 @@ class Net_SMTP */ function quotedata(&$data) { - /* Change Unix (\n) and Mac (\r) linefeeds into - * Internet-standard CRLF (\r\n) linefeeds. */ - $data = preg_replace(array('/(?<!\r)\n/','/\r(?!\n)/'), "\r\n", $data); - /* Because a single leading period (.) signifies an end to the - * data, legitimate leading periods need to be "doubled" - * (e.g. '..'). */ - $data = str_replace("\n.", "\n..", $data); + * data, legitimate leading periods need to be "doubled" ('..'). */ + $data = preg_replace('/^\./m', '..', $data); + + /* Change Unix (\n) and Mac (\r) linefeeds into CRLF's (\r\n). */ + $data = preg_replace('/(?:\r\n|\n|\r(?!\n))/', "\r\n", $data); } /** |