]>
Commit | Line | Data |
---|---|---|
85c7abaf PG |
1 | --- ./main/SAPI.c.org Sat Jul 27 15:15:42 2002 |
2 | +++ ./main/SAPI.c Sat Sep 7 11:13:49 2002 | |
9d6174b1 | 3 | @@ -27,9 +27,6 @@ |
d39a6d5a | 4 | #include "SAPI.h" |
5 | #include "ext/standard/php_string.h" | |
6 | #include "ext/standard/pageinfo.h" | |
85c7abaf | 7 | -#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) |
d39a6d5a | 8 | -#include "ext/pcre/php_pcre.h" |
9 | -#endif | |
10 | #ifdef ZTS | |
11 | #include "TSRM.h" | |
12 | #endif | |
85c7abaf | 13 | @@ -480,62 +477,6 @@ |
d39a6d5a | 14 | SG(sapi_headers).http_response_code = 401; /* authentication-required */ |
85c7abaf PG |
15 | |
16 | if(PG(safe_mode)) | |
17 | -#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) | |
18 | - { | |
19 | - zval *repl_temp; | |
20 | - char *ptr = colon_offset+1; | |
21 | - int ptr_len=0, result_len = 0; | |
22 | - | |
d39a6d5a | 23 | - myuid = php_getuid(); |
24 | - | |
25 | - ptr_len = strlen(ptr); | |
26 | - MAKE_STD_ZVAL(repl_temp); | |
d1fc9dcc | 27 | - Z_TYPE_P(repl_temp) = IS_STRING; |
d39a6d5a | 28 | - Z_STRVAL_P(repl_temp) = emalloc(32); |
29 | - Z_STRLEN_P(repl_temp) = sprintf(Z_STRVAL_P(repl_temp), "realm=\"\\1-%ld\"", myuid); | |
30 | - /* Modify quoted realm value */ | |
31 | - result = php_pcre_replace("/realm=\"(.*?)\"/i", 16, | |
32 | - ptr, ptr_len, | |
33 | - repl_temp, | |
34 | - 0, &result_len, -1 TSRMLS_CC); | |
35 | - if(result_len==ptr_len) { | |
36 | - efree(result); | |
37 | - sprintf(Z_STRVAL_P(repl_temp), "realm=\\1-%ld\\2", myuid); | |
38 | - /* modify unquoted realm value */ | |
39 | - result = php_pcre_replace("/realm=([^\\s]+)(.*)/i", 21, | |
40 | - ptr, ptr_len, | |
41 | - repl_temp, | |
42 | - 0, &result_len, -1 TSRMLS_CC); | |
43 | - if(result_len==ptr_len) { | |
44 | - char *lower_temp = estrdup(ptr); | |
45 | - char conv_temp[32]; | |
46 | - int conv_len; | |
47 | - | |
48 | - php_strtolower(lower_temp,strlen(lower_temp)); | |
49 | - /* If there is no realm string at all, append one */ | |
50 | - if(!strstr(lower_temp,"realm")) { | |
51 | - efree(result); | |
52 | - conv_len = sprintf(conv_temp," realm=\"%ld\"",myuid); | |
53 | - result = emalloc(ptr_len+conv_len+1); | |
9d6174b1 | 54 | - result_len = ptr_len+conv_len; |
d39a6d5a | 55 | - memcpy(result, ptr, ptr_len); |
56 | - memcpy(result+ptr_len, conv_temp, conv_len); | |
57 | - *(result+ptr_len+conv_len) = '\0'; | |
58 | - } | |
59 | - efree(lower_temp); | |
60 | - } | |
61 | - } | |
62 | - newlen = sizeof("WWW-Authenticate: ") + result_len; | |
63 | - newheader = emalloc(newlen+1); | |
64 | - sprintf(newheader,"WWW-Authenticate: %s", result); | |
65 | - efree(header_line); | |
66 | - sapi_header.header = newheader; | |
67 | - sapi_header.header_len = newlen; | |
68 | - efree(result); | |
69 | - efree(Z_STRVAL_P(repl_temp)); | |
70 | - efree(repl_temp); | |
9d6174b1 | 71 | - } |
d39a6d5a | 72 | -#else |
85c7abaf | 73 | { |
d39a6d5a | 74 | myuid = php_getuid(); |
75 | result = emalloc(32); | |
85c7abaf | 76 | @@ -546,7 +487,6 @@ |
d39a6d5a | 77 | sapi_header.header_len = newlen; |
78 | efree(result); | |
79 | } | |
80 | -#endif | |
81 | } | |
82 | if (sapi_header.header==header_line) { | |
83 | *colon_offset = ':'; |