]> git.pld-linux.org Git - packages/php.git/blob - php-mail.patch
- don't use pcre functions in standard/aggregation functions if building pcre extensi...
[packages/php.git] / php-mail.patch
1 --- php-4.3.0/ext/standard/mail.c.orig  Fri Nov 29 12:15:43 2002
2 +++ php-4.3.0/ext/standard/mail.c       Thu Jan  2 12:37:54 2003
3 @@ -21,6 +21,8 @@
4  #include <stdlib.h>
5  #include <ctype.h>
6  #include <stdio.h>
7 +#include <syslog.h>
8 +#include <string.h>
9  #include "php.h"
10  #include "ext/standard/info.h"
11  
12 @@ -36,6 +38,9 @@
13  #include "safe_mode.h"
14  #include "exec.h"
15  
16 +#include "zend_operators.h"
17 +#include "zend_globals.h"
18 +
19  #if HAVE_SENDMAIL
20  #ifdef PHP_WIN32
21  #include "win32/sendmail.h"
22 @@ -196,8 +201,42 @@
23                         return 0;
24                 }
25  #endif
26 -               fprintf(sendmail, "To: %s\n", to);
27 -               fprintf(sendmail, "Subject: %s\n", subject);
28 +               TSRMLS_FETCH();
29 +               
30 +               if ((to != NULL) && (strlen(to)!=0)) { 
31 +                       fprintf(sendmail, "To: %s\n", to);
32 +               }
33 +               if ((subject != NULL) && (strlen(subject)!=0)) {
34 +                       fprintf(sendmail, "Subject: %s\n", subject);
35 +               }
36 +
37 +               if (PG(http_globals)[TRACK_VARS_SERVER]) {
38 +                       zval **remote_addr, **server_name, **server_port,
39 +                               **request_uri, **http_user_agent;
40 +                       
41 +                       if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **) &remote_addr)==SUCCESS) {
42 +                               convert_to_string_ex(remote_addr);
43 +                               fprintf(sendmail, "HTTP-Posting-Client: %s\n", Z_STRVAL_PP(remote_addr));
44 +                       }
45 +                       if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name)==SUCCESS) {
46 +                               convert_to_string_ex(server_name);
47 +                               fprintf(sendmail, "HTTP-Posting-URI: %s", Z_STRVAL_PP(server_name));
48 +                               if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_PORT", sizeof("SERVER_PORT"), (void **) &server_port)==SUCCESS) {
49 +                                       convert_to_string_ex(server_port);
50 +                                       fprintf(sendmail, ":%s", Z_STRVAL_PP(server_port));
51 +                               }       
52 +                               if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &request_uri)==SUCCESS) {
53 +                                       convert_to_string_ex(request_uri);
54 +                                       fprintf(sendmail, "%s", Z_STRVAL_PP(request_uri));
55 +                               }
56 +                               fprintf(sendmail, "\n");
57 +                       }
58 +                       if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &http_user_agent)==SUCCESS) {
59 +                               convert_to_string_ex(http_user_agent);
60 +                                       fprintf(sendmail, "HTTP-Posting-User-Agent: %s\n", Z_STRVAL_PP(http_user_agent));
61 +                       }
62 +               }
63 +
64                 if (headers != NULL) {
65                         fprintf(sendmail, "%s\n", headers);
66                 }
This page took 0.030443 seconds and 3 git commands to generate.