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  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2003-09-18 14:44 UTC
Package:
Bug Type:
Summary:
From: christof dot roduner at npocom dot ch
New email:
PHP Version: Package Version: OS:

 

 [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.