--- embedaddon/php/ext/standard/mail.c 2012/02/21 23:48:02 1.1.1.1 +++ embedaddon/php/ext/standard/mail.c 2013/07/22 01:44:16 1.1.1.2.2.1 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mail.c,v 1.1.1.1 2012/02/21 23:48:02 misho Exp $ */ +/* $Id: mail.c,v 1.1.1.2.2.1 2013/07/22 01:44:16 misho Exp $ */ #include #include @@ -42,7 +42,6 @@ #include "php_mail.h" #include "php_ini.h" #include "php_string.h" -#include "safe_mode.h" #include "exec.h" #ifdef PHP_WIN32 @@ -70,7 +69,7 @@ *p = ' '; \ } \ -extern long php_getuid(void); +extern long php_getuid(TSRMLS_D); /* {{{ proto int ezmlm_hash(string addr) Calculate EZMLM list hash value. */ @@ -106,14 +105,7 @@ PHP_FUNCTION(mail) char *to_r, *subject_r; char *p, *e; - if (PG(safe_mode) && (ZEND_NUM_ARGS() == 5)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE"); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ss", &to, &to_len, &subject, &subject_len, &message, &message_len, - &headers, &headers_len, &extra_cmd, &extra_cmd_len) == FAILURE - ) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ss", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd, &extra_cmd_len) == FAILURE) { return; } @@ -240,16 +232,16 @@ PHPAPI int php_mail(char *to, char *subject, char *mes efree(tmp); } if (PG(mail_x_header)) { - char *tmp = zend_get_executed_filename(TSRMLS_C); + const char *tmp = zend_get_executed_filename(TSRMLS_C); char *f; size_t f_len; php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC); if (headers != NULL) { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(), f, headers); + spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers); } else { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n", php_getuid(), f); + spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n", php_getuid(TSRMLS_C), f); } efree(f); } @@ -288,7 +280,7 @@ PHPAPI int php_mail(char *to, char *subject, char *mes #endif #ifdef PHP_WIN32 - sendmail = popen(sendmail_cmd, "wb"); + sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL TSRMLS_CC); #else /* Since popen() doesn't indicate if the internal fork() doesn't work * (e.g. the shell can't be executed) we explicitely set it to 0 to be