]> git.pld-linux.org Git - packages/php.git/blobdiff - php-mail.patch
use /var/run for fpm pid files
[packages/php.git] / php-mail.patch
index 0eee7ebbc1a99f057dc168e46aece8c1d6943b44..5881c7519a61ddfdcf6f1c5e47ff3da98a2b479d 100644 (file)
@@ -1,5 +1,5 @@
---- php-4.3.0/ext/standard/mail.c.orig Fri Nov 29 12:15:43 2002
-+++ php-4.3.0/ext/standard/mail.c      Thu Jan  2 12:37:54 2003
+--- php-5.2.0/ext/standard/mail.c      2006-12-01 14:20:27.881416250 +0100
++++ php-5.2.4/ext/standard/mail.c      2007-08-31 19:25:50.777713042 +0300
 @@ -21,6 +21,8 @@
  #include <stdlib.h>
  #include <ctype.h>
@@ -9,17 +9,35 @@
  #include "php.h"
  #include "ext/standard/info.h"
  
-@@ -36,6 +38,9 @@
+@@ -35,6 +37,8 @@
+ #include "php_ini.h"
  #include "safe_mode.h"
  #include "exec.h"
 +#include "zend_operators.h"
 +#include "zend_globals.h"
-+
- #if HAVE_SENDMAIL
  #ifdef PHP_WIN32
  #include "win32/sendmail.h"
-@@ -196,8 +201,42 @@
+@@ -107,6 +111,18 @@
+               return;
+       }
++    /* search for To: and Subject: headers which should be specified in proper mail() parameters, not in additional headers */
++    if (headers != NULL) {
++        if (strncasecmp(headers, "to:", sizeof("to:") - 1) == 0 || strcasestr(headers, "\nto:")) {
++            php_error_docref(NULL TSRMLS_CC, E_WARNING, "To: headers aren't allowed in the additional_headers parameter. Use $to parameter for that. Mail not sent.");
++            RETURN_FALSE;
++        }
++        if (strncasecmp(headers, "subject:", sizeof("subject:") - 1) == 0 || strcasestr(headers, "\nsubject:")) {
++            php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject: headers aren't allowed in the additional_headers parameter. Use $subject parameter for that. Mail not sent.");
++            RETURN_FALSE;
++        }
++    }
++
+       if (to_len > 0) {
+               to_r = estrndup(to, to_len);
+               for (; to_len; to_len--) {
+@@ -231,8 +247,42 @@
                        return 0;
                }
  #endif
@@ -36,7 +54,7 @@
 +
 +              if (PG(http_globals)[TRACK_VARS_SERVER]) {
 +                      zval **remote_addr, **server_name, **server_port,
-+                              **request_uri, **http_user_agent;
++                              **script_name, **http_user_agent;
 +                      
 +                      if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **) &remote_addr)==SUCCESS) {
 +                              convert_to_string_ex(remote_addr);
 +                      }
 +                      if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name)==SUCCESS) {
 +                              convert_to_string_ex(server_name);
-+                              fprintf(sendmail, "HTTP-Posting-URI: %s\n", Z_STRVAL_PP(server_name));
++                              fprintf(sendmail, "HTTP-Posting-URI: %s", Z_STRVAL_PP(server_name));
 +                              if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_PORT", sizeof("SERVER_PORT"), (void **) &server_port)==SUCCESS) {
 +                                      convert_to_string_ex(server_port);
 +                                      fprintf(sendmail, ":%s", Z_STRVAL_PP(server_port));
 +                              }       
-+                              if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &request_uri)==SUCCESS) {
-+                                      convert_to_string_ex(request_uri);
-+                                      fprintf(sendmail, "%s", Z_STRVAL_PP(request_uri));
++                              if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==SUCCESS) {
++                                      convert_to_string_ex(script_name);
++                                      fprintf(sendmail, "%s", Z_STRVAL_PP(script_name));
 +                              }
 +                              fprintf(sendmail, "\n");
 +                      }
This page took 0.039492 seconds and 4 git commands to generate.