mail must exclude $params if 'safe_mode' is on - null is not an option #868

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

No description provided.

@lorenzo lorenzo closed this Sep 25, 2012

No it's not, when u send null as 5th param mail function doesn't work. If safe_mode is on mail function cannot receive 5th param, null is not an option.

Member

ADmad commented Sep 26, 2012

We should have made safe_mode off a requirement in 2.0, alas its too late. Thankfully its gone all together in php 5.4 it won't be an issue in cake 3.0

Owner

markstory commented Sep 26, 2012

Safe mode is one of the stupidest features in PHP. If we need to include this, can we at least fix all the code standards errors?

- if (!@mail($to, $subject, $message, $headers, $params)) {
- throw new SocketException(__d('cake_dev', 'Could not send email.'));
+ protected function _mail($to, $subject, $message, $headers, $params = null) {
+ if ( !ini_get( 'safe_mode' ) ){
@markstory

markstory Sep 26, 2012

Owner

Should be if ( and ) { Also no spaces around function arguments.

+ if (!@mail($to, $subject, $message, $headers, $params)) {
+ throw new SocketException(__d('cake_dev', 'Could not send email.'));
+ }
+ }else{
@markstory

markstory Sep 26, 2012

Owner

Should be } else {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment