]> git.pld-linux.org Git - packages/php.git/blobdiff - php-mail.patch
- release 16 (by relup.sh)
[packages/php.git] / php-mail.patch
index 3503e81ed1c6c312ca6b4afff804e57f3db2fa20..257a9c48487428679ea1ee8ce8659739a68dd3c9 100644 (file)
@@ -1,33 +1,5 @@
-Only in php-4.0RC1/ext/standard/: .libs
-Only in php-4.0RC1/ext/standard/: Makefile
-Only in php-4.0RC1/ext/standard/: array.lo
-Only in php-4.0RC1/ext/standard/: assert.lo
-Only in php-4.0RC1/ext/standard/: base64.lo
-Only in php-4.0RC1/ext/standard/: basic_functions.lo
-Only in php-4.0RC1/ext/standard/: browscap.lo
-Only in php-4.0RC1/ext/standard/: crypt.lo
-Only in php-4.0RC1/ext/standard/: cyr_convert.lo
-Only in php-4.0RC1/ext/standard/: datetime.lo
-Only in php-4.0RC1/ext/standard/: dir.lo
-Only in php-4.0RC1/ext/standard/: dl.lo
-Only in php-4.0RC1/ext/standard/: dns.lo
-Only in php-4.0RC1/ext/standard/: exec.lo
-Only in php-4.0RC1/ext/standard/: file.lo
-Only in php-4.0RC1/ext/standard/: filestat.lo
-Only in php-4.0RC1/ext/standard/: flock_compat.lo
-Only in php-4.0RC1/ext/standard/: formatted_print.lo
-Only in php-4.0RC1/ext/standard/: fsock.lo
-Only in php-4.0RC1/ext/standard/: head.lo
-Only in php-4.0RC1/ext/standard/: html.lo
-Only in php-4.0RC1/ext/standard/: image.lo
-Only in php-4.0RC1/ext/standard/: info.lo
-Only in php-4.0RC1/ext/standard/: iptc.lo
-Only in php-4.0RC1/ext/standard/: lcg.lo
-Only in php-4.0RC1/ext/standard/: libstandard.la
-Only in php-4.0RC1/ext/standard/: link.lo
-diff -ru php-4.0RC1.old/ext/standard/mail.c php-4.0RC1/ext/standard/mail.c
---- php-4.0RC1.old/ext/standard/mail.c Mon Mar  6 21:37:11 2000
-+++ php-4.0RC1/ext/standard/mail.c     Tue Apr  4 03:13:33 2000
+--- 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>
@@ -35,41 +7,78 @@ diff -ru php-4.0RC1.old/ext/standard/mail.c php-4.0RC1/ext/standard/mail.c
 +#include <syslog.h>
 +#include <string.h>
  #include "php.h"
- #if !defined(PHP_WIN32)
- #include "build-defs.h"
-@@ -112,8 +114,12 @@
-       sendmail = popen(sendmail_path, "w");
+ #include "ext/standard/info.h"
  
-       if (sendmail) {
+@@ -35,6 +37,8 @@
+ #include "php_ini.h"
+ #include "safe_mode.h"
+ #include "exec.h"
++#include "zend_operators.h"
++#include "zend_globals.h"
+ #ifdef PHP_WIN32
+ #include "win32/sendmail.h"
+@@ -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
 -              fprintf(sendmail, "To: %s\n", to);
 -              fprintf(sendmail, "Subject: %s\n", subject);
++              TSRMLS_FETCH();
++              
 +              if ((to != NULL) && (strlen(to)!=0)) { 
 +                      fprintf(sendmail, "To: %s\n", to);
 +              }
 +              if ((subject != NULL) && (strlen(subject)!=0)) {
 +                      fprintf(sendmail, "Subject: %s\n", subject);
 +              }
-               if (headers != NULL) {
-                       fprintf(sendmail, "%s\n", headers);
++              zend_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC);
++              if (PG(http_globals)[TRACK_VARS_SERVER]) {
++                      zval **remote_addr, **server_name, **server_port,
++                              **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);
++                              fprintf(sendmail, "HTTP-Posting-Client: %s\n", Z_STRVAL_PP(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", 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, "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");
++                      }
++                      if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &http_user_agent)==SUCCESS) {
++                              convert_to_string_ex(http_user_agent);
++                                      fprintf(sendmail, "HTTP-Posting-User-Agent: %s\n", Z_STRVAL_PP(http_user_agent));
++                      }
++              }
++
+               if (hdr != NULL) {
+                       fprintf(sendmail, "%s\n", hdr);
                }
-Only in php-4.0RC1/ext/standard/: mail.c~
-Only in php-4.0RC1/ext/standard/: mail.lo
-Only in php-4.0RC1/ext/standard/: math.lo
-Only in php-4.0RC1/ext/standard/: md5.lo
-Only in php-4.0RC1/ext/standard/: metaphone.lo
-Only in php-4.0RC1/ext/standard/: microtime.lo
-Only in php-4.0RC1/ext/standard/: output.lo
-Only in php-4.0RC1/ext/standard/: pack.lo
-Only in php-4.0RC1/ext/standard/: pageinfo.lo
-Only in php-4.0RC1/ext/standard/: parsedate.lo
-Only in php-4.0RC1/ext/standard/: quot_print.lo
-Only in php-4.0RC1/ext/standard/: rand.lo
-Only in php-4.0RC1/ext/standard/: reg.lo
-Only in php-4.0RC1/ext/standard/: soundex.lo
-Only in php-4.0RC1/ext/standard/: string.lo
-Only in php-4.0RC1/ext/standard/: syslog.lo
-Only in php-4.0RC1/ext/standard/: type.lo
-Only in php-4.0RC1/ext/standard/: uniqid.lo
-Only in php-4.0RC1/ext/standard/: url.lo
-Only in php-4.0RC1/ext/standard/: url_scanner.lo
-Only in php-4.0RC1/ext/standard/: var.lo
This page took 0.033691 seconds and 4 git commands to generate.