cvs: php4 /ext/standard mail.c

From: Date: Tue, 02 Jul 2002 13:56:49 +0000
Subject: cvs: php4 /ext/standard mail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12660@lists.php.net to get a copy of this message
derick Tue Jul 2 09:56:49 2002 EDT Modified files: /php4/ext/standard mail.c Log: - Disable 5th parameter to mail in safemode @- Disabled the fifth parameter to the mail function in safemode. (Derick) Index: php4/ext/standard/mail.c diff -u php4/ext/standard/mail.c:1.54 php4/ext/standard/mail.c:1.55 --- php4/ext/standard/mail.c:1.54 Thu Jun 13 14:54:45 2002 +++ php4/ext/standard/mail.c Tue Jul 2 09:56:47 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mail.c,v 1.54 2002/06/13 18:54:45 sesser Exp $ */ +/* $Id: mail.c,v 1.55 2002/07/02 13:56:47 derick Exp $ */ #include <stdlib.h> #include <ctype.h> @@ -71,7 +71,11 @@ { char *to=NULL, *message=NULL, *headers=NULL, *subject=NULL, *extra_cmd=NULL; int to_len,message_len,headers_len,subject_len,extra_cmd_len,i; - + + if (PG(safe_mode) && (ZEND_NUM_ARGS() == 5)) { + php_error(E_WARNING, "%s(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE.", get_active_function_name(TSRMLS_C)); + return; + } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ss", &to, &to_len, @@ -132,10 +136,10 @@ /* handle old style win smtp sending */ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message) == FAILURE) { if (tsm_errmsg) { - php_error(E_WARNING, "%s() %s", get_active_function_name(TSRMLS_C), tsm_errmsg); + php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), tsm_errmsg); efree(tsm_errmsg); } else { - php_error(E_WARNING, "%s() %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err)); + php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err)); } return 0; } @@ -168,7 +172,7 @@ if (sendmail) { #ifndef PHP_WIN32 if (EACCES == errno) { - php_error(E_WARNING, "%s() permission denied; unable to execute shell to run mail delivery binary", + php_error(E_WARNING, "%s(): Permission denied; unable to execute shell to run mail delivery binary", get_active_function_name(TSRMLS_C)); pclose(sendmail); return 0; @@ -196,7 +200,7 @@ return 1; } } else { - php_error(E_WARNING, "%s() could not execute mail delivery program", + php_error(E_WARNING, "%s(): Could not execute mail delivery program", get_active_function_name(TSRMLS_C)); return 0; }

« previous php.cvs (#12660) next »