summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-11-17 22:09:45 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-11-17 22:09:45 +0100
commitc630bcfca816f625b8cd70a1a7467a77c8065bbd (patch)
tree8473da3f7e37ad900b1ecbd8a028a70aada76e56 /system
parent7b49203821a1e36ef566e0e08e4f658b8232f10c (diff)
added sendmail debugging and fixed a bug with single to double quoted string syntax in from()
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Email.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 94f517c45..89d0976ae 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -189,7 +189,7 @@ class CI_Email {
if ( ! preg_match('/[\200-\377]/', $name))
{
// add slashes for non-printing characters, slashes, and double quotes, and surround it in double quotes
- $name = '"'.addcslashes($name, '\0..\37\177"\\').'"';
+ $name = '"'.addcslashes($name, "\0..\37\177'\"\\").'"';
}
else
{
@@ -1539,16 +1539,22 @@ class CI_Email {
{
$fp = @popen($this->mailpath . " -oi -f ".$this->clean_email($this->_headers['From'])." -t", 'w');
- if ( ! is_resource($fp))
+ fputs($fp, $this->_header_str);
+ fputs($fp, $this->_finalbody);
+
+ $status = pclose($fp);
+
+ if (version_compare(PHP_VERSION, '4.2.3') == -1)
+ {
+ $status = $status >> 8 & 0xFF;
+ }
+
+ if ($status == 0)
{
$this->_set_error_message('email_no_socket');
return FALSE;
}
- fputs($fp, $this->_header_str);
- fputs($fp, $this->_finalbody);
- pclose($fp) >> 8 & 0xFF;
-
return TRUE;
}