diff options
-rw-r--r-- | system/libraries/Email.php | 18 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 13 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; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6f23617b9..670e82c38 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@ SVN Revision: </p> <li>Changed default current page indicator in the Pagination library to use <strong> instead of <b></li> <li>A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.</li> <li>Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.</li> + <li>Added more accurate error reporting for the Email library when using sendmail.</li> </ul> </li> <li>Helpers |