Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0

Bug #19 Mail_mail::send() fails with safe mode switched on
Submitted: 2003-09-17 14:54 UTC
From: christof dot roduner at npocom dot ch Assigned: chagenbu
Status: Closed Package: Mail
PHP Version: 4.3.3 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 50 + 43 = ?

 
 [2003-09-17 14:54 UTC] christof dot roduner at npocom dot ch
Description: ------------ If safe mode is switched on, Mail_mail::send() will fail with the following error message: Warning: mail(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. The problem occurs even though only a backend driver, but no params are passed to the factory method. Here's a patch that fixed the problem for me: --- mail.php~ Wed Sep 17 16:09:02 2003 +++ mail.php Wed Sep 17 16:14:47 2003 @@ -109,7 +109,12 @@ // flatten the headers out. list(,$text_headers) = Mail::prepareHeaders($headers); - return mail($recipients, $subject, $body, $text_headers, $this->_params); + // Only pass fifth parameter to mail() if safe mode is off. + if (ini_get('safe_mode') == '1') { + return mail($recipients, $subject, $body, $text_headers); + } else { + return mail($recipients, $subject, $body, $text_headers, $this->_params); + } } } Best regards, Christof

Comments

 [2003-09-18 14:44 UTC] chagenbu at php dot net
This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better.