Guys, another bug fix for 1.5.1. Found the following problem in library Email.php:
Line 120:
$this->_safe_mode = (@ini_get("safe_mode") == 0) ? FALSE : TRUE;
Our application is running in SAFE_MODE and can’t send email’s. This is because safe mode restricts the mail() function from using the fifth parameter:
function _send_with_mail()
{
if ($this->_safe_mode == TRUE)
{
if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str))
return FALSE;
else
return TRUE;
}
else
{
if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f".$this->clean_email($this->_headers['From'])))
return FALSE;
else
return TRUE;
}
}
Conclusion: the safe_mode check is incorrect. init_get can also return a string “On”. The correct code would be:
$this->_safe_mode = (@ini_get("safe_mode") == 'On' || @init_get("safe_mode") === 1) ? TRUE : FALSE;
