Permalink
Browse files

Add fix for http://pear.php.net/bugs/bug.php?id=18819

  • Loading branch information...
1 parent 51fcb01 commit bf73e037d63e15728160b545531eaf7948dc4092 @thomascube thomascube committed Aug 13, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 program/lib/Net/SMTP.php
View
@@ -936,14 +936,12 @@ function rcptTo($recipient, $params = null)
*/
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);
}
/**

0 comments on commit bf73e03

Please sign in to comment.