summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Email.php')
-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;
}