mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
win32/sendmail.c: remove mailCc parameter that is always NULL
This commit is contained in:
@@ -543,7 +543,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
|
||||
char *tsm_errmsg = NULL;
|
||||
|
||||
/* handle old style win smtp sending */
|
||||
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL) == FAILURE) {
|
||||
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message) == FAILURE) {
|
||||
if (tsm_errmsg) {
|
||||
php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
|
||||
efree(tsm_errmsg);
|
||||
|
||||
@@ -111,7 +111,7 @@ static const char *ErrorMessages[] =
|
||||
#define PHP_WIN32_MAIL_DOT_PATTERN "\n."
|
||||
#define PHP_WIN32_MAIL_DOT_REPLACE "\n.."
|
||||
|
||||
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, const char *data,
|
||||
static int SendText(char *RPath, const char *Subject, const char *mailTo, const char *data,
|
||||
const char *headers, char *headers_lc, char **error_message);
|
||||
static int MailConnect();
|
||||
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
|
||||
@@ -185,8 +185,7 @@ static zend_string *php_win32_mail_trim_header(const char *header)
|
||||
// See SendText() for additional args!
|
||||
//*********************************************************************
|
||||
PHPAPI int TSendMail(const char *host, int *error, char **error_message,
|
||||
const char *headers, const char *Subject, const char *mailTo, const char *data,
|
||||
char *mailCc)
|
||||
const char *headers, const char *Subject, const char *mailTo, const char *data)
|
||||
{
|
||||
int ret;
|
||||
char *RPath = NULL;
|
||||
@@ -279,7 +278,7 @@ PHPAPI int TSendMail(const char *host, int *error, char **error_message,
|
||||
PW32G(mail_host), !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port"));
|
||||
return FAILURE;
|
||||
} else {
|
||||
ret = SendText(RPath, Subject, mailTo, mailCc, data, headers ? ZSTR_VAL(headers_trim) : NULL, headers ? ZSTR_VAL(headers_lc) : NULL, error_message);
|
||||
ret = SendText(RPath, Subject, mailTo, data, headers ? ZSTR_VAL(headers_trim) : NULL, headers ? ZSTR_VAL(headers_lc) : NULL, error_message);
|
||||
TSMClose();
|
||||
if (RPath) {
|
||||
efree(RPath);
|
||||
@@ -387,7 +386,7 @@ static char *find_address(char *list, char **state)
|
||||
// Author/Date: jcar 20/9/96
|
||||
// History:
|
||||
//*********************************************************************
|
||||
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, const char *data,
|
||||
static int SendText(char *RPath, const char *Subject, const char *mailTo, const char *data,
|
||||
const char *headers, char *headers_lc, char **error_message)
|
||||
{
|
||||
int res;
|
||||
@@ -464,29 +463,8 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, char *
|
||||
}
|
||||
efree(tempMailTo);
|
||||
|
||||
if (mailCc && *mailCc) {
|
||||
tempMailTo = estrdup(mailCc);
|
||||
/* Send mail to all rcpt's */
|
||||
token = find_address(tempMailTo, &token_state);
|
||||
while (token != NULL)
|
||||
{
|
||||
SMTP_SKIP_SPACE(token);
|
||||
FormatEmailAddress(PW32G(mail_buffer), token, "RCPT TO:<%s>\r\n");
|
||||
if (!Post(PW32G(mail_buffer))) {
|
||||
efree(tempMailTo);
|
||||
return (FAILED_TO_SEND);
|
||||
}
|
||||
if ((res = Ack(&server_response)) != SUCCESS) {
|
||||
SMTP_ERROR_RESPONSE(server_response);
|
||||
efree(tempMailTo);
|
||||
return (res);
|
||||
}
|
||||
token = find_address(NULL, &token_state);
|
||||
}
|
||||
efree(tempMailTo);
|
||||
}
|
||||
/* Send mail to all Cc rcpt's */
|
||||
else if (headers && (pos1 = strstr(headers_lc, "cc:")) && ((pos1 == headers_lc) || (*(pos1-1) == '\n'))) {
|
||||
if (headers && (pos1 = strstr(headers_lc, "cc:")) && ((pos1 == headers_lc) || (*(pos1-1) == '\n'))) {
|
||||
/* Real offset is memaddress from the original headers + difference of
|
||||
* string found in the lowercase headers + 3 characters to jump over
|
||||
* the cc: */
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
|
||||
|
||||
PHPAPI int TSendMail(const char *host, int *error, char **error_message,
|
||||
const char *headers, const char *Subject, const char *mailTo, const char *data,
|
||||
char *mailCc);
|
||||
const char *headers, const char *Subject, const char *mailTo, const char *data);
|
||||
PHPAPI void TSMClose(void);
|
||||
PHPAPI const char *GetSMErrorText(int index);
|
||||
#endif /* sendmail_h */
|
||||
|
||||
Reference in New Issue
Block a user