]> git.pld-linux.org Git - packages/php.git/blob - php-no_php_pcre_in_SAPI_c.patch
- workaround for broken threads m4 macros
[packages/php.git] / php-no_php_pcre_in_SAPI_c.patch
1 diff -Nur php-4.1.2.orig/main/SAPI.c php-4.1.2/main/SAPI.c
2 --- php-4.1.2.orig/main/SAPI.c  Mon Jan 14 14:43:03 2002
3 +++ php-4.1.2/main/SAPI.c       Wed Feb 27 15:21:13 2002
4 @@ -25,9 +25,6 @@
5  #include "SAPI.h"
6  #include "ext/standard/php_string.h"
7  #include "ext/standard/pageinfo.h"
8 -#if HAVE_PCRE || HAVE_BUNDLED_PCRE
9 -#include "ext/pcre/php_pcre.h"
10 -#endif
11  #ifdef ZTS
12  #include "TSRM.h"
13  #endif
14 @@ -448,65 +445,8 @@
15                         } else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */
16                                 int newlen;
17                                 char *result, *newheader;
18 -#if HAVE_PCRE || HAVE_BUNDLED_PCRE
19 -                               zval *repl_temp;
20 -                               char *ptr = colon_offset+1;
21 -                               int ptr_len=0, result_len = 0;
22 -#endif
23  
24                                 SG(sapi_headers).http_response_code = 401; /* authentication-required */
25 -#if HAVE_PCRE || HAVE_BUNDLED_PCRE
26 -                               if(PG(safe_mode)) {
27 -                                       myuid = php_getuid();
28 -
29 -                                       ptr_len = strlen(ptr);
30 -                                       MAKE_STD_ZVAL(repl_temp);
31 -                                       Z_TYPE_P(repl_temp) = IS_STRING;
32 -                                       Z_STRVAL_P(repl_temp) = emalloc(32);
33 -                                       Z_STRLEN_P(repl_temp) = sprintf(Z_STRVAL_P(repl_temp), "realm=\"\\1-%ld\"", myuid);
34 -                                       /* Modify quoted realm value */
35 -                                       result = php_pcre_replace("/realm=\"(.*?)\"/i", 16,
36 -                                                                                        ptr, ptr_len,
37 -                                                                                        repl_temp,
38 -                                                                                        0, &result_len, -1 TSRMLS_CC);
39 -                                       if(result_len==ptr_len) {
40 -                                               efree(result);
41 -                                               sprintf(Z_STRVAL_P(repl_temp), "realm=\\1-%ld\\2", myuid);
42 -                                               /* modify unquoted realm value */
43 -                                               result = php_pcre_replace("/realm=([^\\s]+)(.*)/i", 21, 
44 -                                                                                               ptr, ptr_len,
45 -                                                                                               repl_temp,
46 -                                                                                               0, &result_len, -1 TSRMLS_CC);
47 -                                               if(result_len==ptr_len) {
48 -                                                       char *lower_temp = estrdup(ptr);        
49 -                                                       char conv_temp[32];
50 -                                                       int conv_len;
51 -
52 -                                                       php_strtolower(lower_temp,strlen(lower_temp));
53 -                                                       /* If there is no realm string at all, append one */
54 -                                                       if(!strstr(lower_temp,"realm")) {
55 -                                                               efree(result);
56 -                                                               conv_len = sprintf(conv_temp," realm=\"%ld\"",myuid);           
57 -                                                               result = emalloc(ptr_len+conv_len+1);
58 -                                                               result_len = ptr_len + conv_len;
59 -                                                               memcpy(result, ptr, ptr_len);   
60 -                                                               memcpy(result+ptr_len, conv_temp, conv_len);
61 -                                                               *(result+ptr_len+conv_len) = '\0';
62 -                                                       }
63 -                                                       efree(lower_temp);
64 -                                               }
65 -                                       }
66 -                                       newlen = sizeof("WWW-Authenticate: ") + result_len;
67 -                                       newheader = emalloc(newlen+1);
68 -                                       sprintf(newheader,"WWW-Authenticate: %s", result);
69 -                                       efree(header_line);
70 -                                       sapi_header.header = newheader;
71 -                                       sapi_header.header_len = newlen;
72 -                                       efree(result);
73 -                                       efree(Z_STRVAL_P(repl_temp));
74 -                                       efree(repl_temp);
75 -                               }
76 -#else
77                                 if(PG(safe_mode)) {
78                                         myuid = php_getuid();
79                                         result = emalloc(32);
80 @@ -517,7 +457,6 @@
81                                         sapi_header.header_len = newlen;
82                                         efree(result);
83                                 } 
84 -#endif
85                         }
86                         if (sapi_header.header==header_line) {
87                                 *colon_offset = ':';
This page took 0.039351 seconds and 3 git commands to generate.