View | Details | Raw Unified | Return to bug 53609
Collapse All | Expand All

(-)php4/Makefile (-6 / +12 lines)
Lines 21-26 Link Here
21
21
22
PORTNAME=	php4
22
PORTNAME=	php4
23
PORTVERSION=	4.3.3.r1
23
PORTVERSION=	4.3.3.r1
24
PORTREVISION=	1
24
CATEGORIES?=	lang devel www
25
CATEGORIES?=	lang devel www
25
MASTER_SITES=	http://www.php.net/distributions/ \
26
MASTER_SITES=	http://www.php.net/distributions/ \
26
		http://it.php.net/distributions/ \
27
		http://it.php.net/distributions/ \
Lines 104-115 Link Here
104
.endif
105
.endif
105
106
106
ALL_OPTIONS=	BCMATH BZIP2 CALENDAR CDB CRACK CTYPE CURL DBASE DBX DOMXML \
107
ALL_OPTIONS=	BCMATH BZIP2 CALENDAR CDB CRACK CTYPE CURL DBASE DBX DOMXML \
107
		DOMXSLT EXIF FILEPRO FTP GD GDBM GETTEXT GMP HYPERWAVE ICONV \
108
		DOMXSLT EXIF FILEPRO FRIBIDI FTP GD GDBM GETTEXT GMP HYPERWAVE \
108
		IMAP INTERBASE INIFILE MBSTRING MCAL MCVE MCRYPT MHASH MIME \
109
		ICONV IMAP INTERBASE INIFILE MBSTRING MCAL MCVE MCRYPT MHASH \
109
		MING MYSQL NCURSES OPENLDAP OPENSSL ORACLE PCNTL PCRE PDFLIB \
110
		MIME MING MYSQL NCURSES OPENLDAP OPENSSL ORACLE PCNTL PCRE \
110
		POSIX POSTGRESQL PSPELL READLINE RECODE SESSION SHMOP SNMP \
111
		PDFLIB POSIX POSTGRESQL PSPELL READLINE RECODE SESSION SHMOP \
111
		SOCKETS SYBASEDB SYBASECT SYSVSEM SYSVSHM TOKENIZER UNIXODBC \
112
		SNMP SOCKETS SYBASEDB SYBASECT SYSVSEM SYSVSHM TOKENIZER \
112
		WDDX XML XMLRPC XSLT YAZ YP ZIP ZLIB
113
		UNIXODBC WDDX XML XMLRPC XSLT YAZ YP ZIP ZLIB
113
114
114
.for opt in ${ALL_OPTIONS}
115
.for opt in ${ALL_OPTIONS}
115
.if defined(WITH_${opt}) || defined(WITHOUT_${opt})
116
.if defined(WITH_${opt}) || defined(WITHOUT_${opt})
Lines 274-279 Link Here
274
275
275
.if defined(WITH_FILEPRO)
276
.if defined(WITH_FILEPRO)
276
CONFIGURE_ARGS+=--enable-filepro
277
CONFIGURE_ARGS+=--enable-filepro
278
.endif
279
280
.if defined(WITH_FRIBIDI)
281
LIB_DEPENDS+=	fribidi.0:${PORTSDIR}/converters/fribidi
282
CONFIGURE_ARGS+=--with-fribidi=${LOCALBASE}
277
.endif
283
.endif
278
284
279
.if defined(WITH_FTP)
285
.if defined(WITH_FTP)
(-)php4/files/patch-main::main.c (+139 lines)
Line 0 Link Here
1
--- main/main.c.orig    Sun Jun 22 11:16:39 2003
2
+++ main/main.c Sun Jun 22 11:17:00 2003
3
4
@@ -134,7 +134,6 @@ static int short_track_vars_names_length
5
6
 #define NUM_TRACK_VARS		(sizeof(short_track_vars_names_length)/sizeof(int))
7
8
-
9
 #define SAFE_FILENAME(f) ((f)?(f):"-")
10
11
 /* {{{ PHP_INI_MH
12
@@ -1362,7 +1361,7 @@ static void php_autoglobal_merge(HashTab
13
 static int php_hash_environment(TSRMLS_D)
14
 {
15
 	char *p;
16
-	unsigned char _gpc_flags[3] = {0, 0, 0};
17
+	int _gpc_flags[5] = {0, 0, 0, 0, 0};
18
 	zend_bool have_variables_order;
19
 	zval *dummy_track_vars_array = NULL;
20
 	zend_bool initialized_dummy_track_vars_array=0;
21
@@ -1409,42 +1408,48 @@ static int php_hash_environment(TSRMLS_D
22
 			case 'P':
23
 				if (!_gpc_flags[0] && !SG(headers_sent) && SG(request_info).request_method && !strcmp(SG(request_info).request_method, "POST")) {
24
 					sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC);	/* POST Data */
25
-					_gpc_flags[0]=1;
26
+					_gpc_flags[0]=TRACK_VARS_POST + 1;
27
 				}
28
 				break;
29
 			case 'c':
30
 			case 'C':
31
 				if (!_gpc_flags[1]) {
32
 					sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC);	/* Cookie Data */
33
-					_gpc_flags[1]=1;
34
+					_gpc_flags[1]=TRACK_VARS_COOKIE + 1;
35
 				}
36
 				break;
37
 			case 'g':
38
 			case 'G':
39
 				if (!_gpc_flags[2]) {
40
 					sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);	/* GET Data */
41
-					_gpc_flags[2]=1;
42
+					_gpc_flags[2]=TRACK_VARS_GET + 1;
43
 				}
44
 				break;
45
 			case 'e':
46
 			case 'E':
47
-				if (have_variables_order) {
48
-					ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]);
49
-					array_init(PG(http_globals)[TRACK_VARS_ENV]);
50
-					INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]);
51
-					php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
52
-				} else {
53
-					php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported 'e' element (environment) used in gpc_order - use variables_order instead");
54
+				if (!_gpc_flags[3]) {
55
+					if (have_variables_order) {
56
+						ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]);
57
+						array_init(PG(http_globals)[TRACK_VARS_ENV]);
58
+						INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]);
59
+						php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
60
+					} else {
61
+						php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported 'e' element (environment) used in gpc_order - use variables_order instead");
62
+					}
63
+					_gpc_flags[3]=TRACK_VARS_ENV + 1;
64
 				}
65
 				break;
66
 			case 's':
67
 			case 'S':
68
-				php_register_server_variables(TSRMLS_C);
69
+				if (!_gpc_flags[4]) {
70
+					php_register_server_variables(TSRMLS_C);
71
+					_gpc_flags[4]=TRACK_VARS_SERVER + 1;
72
+				}
73
 				break;
74
 		}
75
 	}
76
77
-	if (!have_variables_order) {
78
+	if (!have_variables_order && !PG(http_globals)[TRACK_VARS_SERVER]) {
79
 		php_register_server_variables(TSRMLS_C);
80
 	}
81
82
@@ -1453,6 +1458,14 @@ static int php_hash_environment(TSRMLS_D
83
 		php_build_argv(SG(request_info).query_string TSRMLS_CC);
84
 	}
85
86
+	if (PG(register_globals)) {
87
+		for (i = 0; i < 5; i++) {
88
+			if (PG(http_globals)[i]) {
89
+				php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[i]) TSRMLS_CC);
90
+			}
91
+		}
92
+	}
93
+
94
 	for (i=0; i<NUM_TRACK_VARS; i++) {
95
 		if (!PG(http_globals)[i]) {
96
 			if (!initialized_dummy_track_vars_array) {
97
@@ -1478,39 +1491,12 @@ static int php_hash_environment(TSRMLS_D
98
 		array_init(form_variables);
99
 		INIT_PZVAL(form_variables);
100
101
-		for (p=variables_order; p && *p; p++) {
102
-			switch (*p) {
103
-				case 'g':
104
-				case 'G':
105
-					php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
106
-					break;
107
-				case 'p':
108
-				case 'P':
109
-					php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
110
-					break;
111
-				case 'c':
112
-				case 'C':
113
-					php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
114
-					break;
115
-			}
116
-		}
117
-
118
-		if (PG(register_globals)) {
119
-			HashPosition pos;
120
-			zval **data;
121
-			char *string_key;
122
-			uint string_key_len;
123
-			ulong num_key;
124
-
125
-			zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(form_variables), &pos);
126
-			while (zend_hash_get_current_data_ex(Z_ARRVAL_P(form_variables), (void **)&data, &pos) == SUCCESS) {
127
-				/* we only register string keys, since we cannot have $1234 */
128
-				if (zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), &string_key, &string_key_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING) {
129
-					ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), string_key, string_key_len, *data, (*data)->refcount+1, 0);
130
-				}
131
-				zend_hash_move_forward_ex(Z_ARRVAL_P(form_variables), &pos);
132
+		for (i = 0; i < 3; i++) {
133
+			if (_gpc_flags[i]) {
134
+				php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[(_gpc_flags[i] - 1)]) TSRMLS_CC);
135
 			}
136
 		}
137
+
138
 		zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL);
139
 	}
(-)php4/scripts/configure.php (+1 lines)
Lines 31-36 Link Here
31
DOMXSLT		"DOM XSLT and EXSLT support (implies DOMXML)" ${WITH_DOMXSLT:-OFF} \
31
DOMXSLT		"DOM XSLT and EXSLT support (implies DOMXML)" ${WITH_DOMXSLT:-OFF} \
32
EXIF		"EXIF support" ${WITH_EXIF:-OFF} \
32
EXIF		"EXIF support" ${WITH_EXIF:-OFF} \
33
FILEPRO		"filePro support" ${WITH_FILEPRO:-OFF} \
33
FILEPRO		"filePro support" ${WITH_FILEPRO:-OFF} \
34
FRIBIDI		"FriBidi support" ${WITH_FRIBIDI:-OFF} \
34
FTP		"FTP support" ${WITH_FTP:-OFF} \
35
FTP		"FTP support" ${WITH_FTP:-OFF} \
35
GD		"GD library support" ${WITH_GD:-OFF} \
36
GD		"GD library support" ${WITH_GD:-OFF} \
36
GDBM		"GDBM database support (dba)" ${WITH_GDBM:-OFF} \
37
GDBM		"GDBM database support (dba)" ${WITH_GDBM:-OFF} \
(-)php4/scripts/php4_options (+1 lines)
Lines 11-16 Link Here
11
WITH_DOMXSLT=OFF
11
WITH_DOMXSLT=OFF
12
WITH_EXIF=OFF
12
WITH_EXIF=OFF
13
WITH_FILEPRO=OFF
13
WITH_FILEPRO=OFF
14
WITH_FRIBIDI=OFF
14
WITH_FTP=OFF
15
WITH_FTP=OFF
15
WITH_GD=OFF
16
WITH_GD=OFF
16
WITH_GDBM=OFF
17
WITH_GDBM=OFF

Return to bug 53609