aboutsummaryrefslogtreecommitdiffstats
path: root/lang/php4
diff options
context:
space:
mode:
authornork <nork@FreeBSD.org>2003-06-24 16:16:25 +0800
committernork <nork@FreeBSD.org>2003-06-24 16:16:25 +0800
commit1d751c50ff0dbb4d16e1d30c19dd2f9285328a3f (patch)
tree185d5562fa2276577423a40301557bfbd7b14093 /lang/php4
parent11bd9200a43857db56179af690f9399f54b25ee1 (diff)
downloadfreebsd-ports-gnome-1d751c50ff0dbb4d16e1d30c19dd2f9285328a3f.tar.gz
freebsd-ports-gnome-1d751c50ff0dbb4d16e1d30c19dd2f9285328a3f.tar.zst
freebsd-ports-gnome-1d751c50ff0dbb4d16e1d30c19dd2f9285328a3f.zip
o Add FriBiDi extension [1]
o New patch-main::main.c file [2]: - Fixed bug #24253 (missing variables when register_globals is on) - Fixed a memory leak when more then 1 E|S flag is passed to gpc_order. - Fixed a memory leak when variables_order is not set and gpc_order has S|s flag. - Optimized out duplicate parsing of the variables order string. PR: ports/53609 Submitted by: Alex Dupre <sysadmin@alexdupre.com> (maintainer) Patched by: Thierry Thomas [1] Requested by: Ian Service [2]
Diffstat (limited to 'lang/php4')
-rw-r--r--lang/php4/Makefile18
-rw-r--r--lang/php4/files/patch-main::main.c139
-rw-r--r--lang/php4/scripts/configure.php1
-rw-r--r--lang/php4/scripts/php4_options1
4 files changed, 153 insertions, 6 deletions
diff --git a/lang/php4/Makefile b/lang/php4/Makefile
index cfaf08447821..ccf3d0604ee6 100644
--- a/lang/php4/Makefile
+++ b/lang/php4/Makefile
@@ -21,6 +21,7 @@
PORTNAME= php4
PORTVERSION= 4.3.3.r1
+PORTREVISION= 1
CATEGORIES?= lang devel www
MASTER_SITES= http://www.php.net/distributions/ \
http://it.php.net/distributions/ \
@@ -104,12 +105,12 @@ SAPI_FILE= "bin/php"
.endif
ALL_OPTIONS= BCMATH BZIP2 CALENDAR CDB CRACK CTYPE CURL DBASE DBX DOMXML \
- DOMXSLT EXIF FILEPRO FTP GD GDBM GETTEXT GMP HYPERWAVE ICONV \
- IMAP INTERBASE INIFILE MBSTRING MCAL MCVE MCRYPT MHASH MIME \
- MING MYSQL NCURSES OPENLDAP OPENSSL ORACLE PCNTL PCRE PDFLIB \
- POSIX POSTGRESQL PSPELL READLINE RECODE SESSION SHMOP SNMP \
- SOCKETS SYBASEDB SYBASECT SYSVSEM SYSVSHM TOKENIZER UNIXODBC \
- WDDX XML XMLRPC XSLT YAZ YP ZIP ZLIB
+ DOMXSLT EXIF FILEPRO FRIBIDI FTP GD GDBM GETTEXT GMP HYPERWAVE \
+ ICONV IMAP INTERBASE INIFILE MBSTRING MCAL MCVE MCRYPT MHASH \
+ MIME MING MYSQL NCURSES OPENLDAP OPENSSL ORACLE PCNTL PCRE \
+ PDFLIB POSIX POSTGRESQL PSPELL READLINE RECODE SESSION SHMOP \
+ SNMP SOCKETS SYBASEDB SYBASECT SYSVSEM SYSVSHM TOKENIZER \
+ UNIXODBC WDDX XML XMLRPC XSLT YAZ YP ZIP ZLIB
.for opt in ${ALL_OPTIONS}
.if defined(WITH_${opt}) || defined(WITHOUT_${opt})
@@ -276,6 +277,11 @@ CONFIGURE_ARGS+=--enable-exif
CONFIGURE_ARGS+=--enable-filepro
.endif
+.if defined(WITH_FRIBIDI)
+LIB_DEPENDS+= fribidi.0:${PORTSDIR}/converters/fribidi
+CONFIGURE_ARGS+=--with-fribidi=${LOCALBASE}
+.endif
+
.if defined(WITH_FTP)
CONFIGURE_ARGS+=--enable-ftp
.endif
diff --git a/lang/php4/files/patch-main::main.c b/lang/php4/files/patch-main::main.c
new file mode 100644
index 000000000000..4ed09ae69f5d
--- /dev/null
+++ b/lang/php4/files/patch-main::main.c
@@ -0,0 +1,139 @@
+--- main/main.c.orig Sun Jun 22 11:16:39 2003
++++ main/main.c Sun Jun 22 11:17:00 2003
+
+@@ -134,7 +134,6 @@ static int short_track_vars_names_length
+
+ #define NUM_TRACK_VARS (sizeof(short_track_vars_names_length)/sizeof(int))
+
+-
+ #define SAFE_FILENAME(f) ((f)?(f):"-")
+
+ /* {{{ PHP_INI_MH
+@@ -1362,7 +1361,7 @@ static void php_autoglobal_merge(HashTab
+ static int php_hash_environment(TSRMLS_D)
+ {
+ char *p;
+- unsigned char _gpc_flags[3] = {0, 0, 0};
++ int _gpc_flags[5] = {0, 0, 0, 0, 0};
+ zend_bool have_variables_order;
+ zval *dummy_track_vars_array = NULL;
+ zend_bool initialized_dummy_track_vars_array=0;
+@@ -1409,42 +1408,48 @@ static int php_hash_environment(TSRMLS_D
+ case 'P':
+ if (!_gpc_flags[0] && !SG(headers_sent) && SG(request_info).request_method && !strcmp(SG(request_info).request_method, "POST")) {
+ sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC); /* POST Data */
+- _gpc_flags[0]=1;
++ _gpc_flags[0]=TRACK_VARS_POST + 1;
+ }
+ break;
+ case 'c':
+ case 'C':
+ if (!_gpc_flags[1]) {
+ sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC); /* Cookie Data */
+- _gpc_flags[1]=1;
++ _gpc_flags[1]=TRACK_VARS_COOKIE + 1;
+ }
+ break;
+ case 'g':
+ case 'G':
+ if (!_gpc_flags[2]) {
+ sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC); /* GET Data */
+- _gpc_flags[2]=1;
++ _gpc_flags[2]=TRACK_VARS_GET + 1;
+ }
+ break;
+ case 'e':
+ case 'E':
+- if (have_variables_order) {
+- ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]);
+- array_init(PG(http_globals)[TRACK_VARS_ENV]);
+- INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]);
+- php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
+- } else {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported 'e' element (environment) used in gpc_order - use variables_order instead");
++ if (!_gpc_flags[3]) {
++ if (have_variables_order) {
++ ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]);
++ array_init(PG(http_globals)[TRACK_VARS_ENV]);
++ INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]);
++ php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
++ } else {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported 'e' element (environment) used in gpc_order - use variables_order instead");
++ }
++ _gpc_flags[3]=TRACK_VARS_ENV + 1;
+ }
+ break;
+ case 's':
+ case 'S':
+- php_register_server_variables(TSRMLS_C);
++ if (!_gpc_flags[4]) {
++ php_register_server_variables(TSRMLS_C);
++ _gpc_flags[4]=TRACK_VARS_SERVER + 1;
++ }
+ break;
+ }
+ }
+
+- if (!have_variables_order) {
++ if (!have_variables_order && !PG(http_globals)[TRACK_VARS_SERVER]) {
+ php_register_server_variables(TSRMLS_C);
+ }
+
+@@ -1453,6 +1458,14 @@ static int php_hash_environment(TSRMLS_D
+ php_build_argv(SG(request_info).query_string TSRMLS_CC);
+ }
+
++ if (PG(register_globals)) {
++ for (i = 0; i < 5; i++) {
++ if (PG(http_globals)[i]) {
++ php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[i]) TSRMLS_CC);
++ }
++ }
++ }
++
+ for (i=0; i<NUM_TRACK_VARS; i++) {
+ if (!PG(http_globals)[i]) {
+ if (!initialized_dummy_track_vars_array) {
+@@ -1478,39 +1491,12 @@ static int php_hash_environment(TSRMLS_D
+ array_init(form_variables);
+ INIT_PZVAL(form_variables);
+
+- for (p=variables_order; p && *p; p++) {
+- switch (*p) {
+- case 'g':
+- case 'G':
+- php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
+- break;
+- case 'p':
+- case 'P':
+- php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
+- break;
+- case 'c':
+- case 'C':
+- php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
+- break;
+- }
+- }
+-
+- if (PG(register_globals)) {
+- HashPosition pos;
+- zval **data;
+- char *string_key;
+- uint string_key_len;
+- ulong num_key;
+-
+- zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(form_variables), &pos);
+- while (zend_hash_get_current_data_ex(Z_ARRVAL_P(form_variables), (void **)&data, &pos) == SUCCESS) {
+- /* we only register string keys, since we cannot have $1234 */
+- 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) {
+- ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), string_key, string_key_len, *data, (*data)->refcount+1, 0);
+- }
+- zend_hash_move_forward_ex(Z_ARRVAL_P(form_variables), &pos);
++ for (i = 0; i < 3; i++) {
++ if (_gpc_flags[i]) {
++ php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[(_gpc_flags[i] - 1)]) TSRMLS_CC);
+ }
+ }
++
+ zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL);
+ }
diff --git a/lang/php4/scripts/configure.php b/lang/php4/scripts/configure.php
index 08f862ee2e63..c2ba88382cba 100644
--- a/lang/php4/scripts/configure.php
+++ b/lang/php4/scripts/configure.php
@@ -31,6 +31,7 @@ DOMXML "DOM support" ${WITH_DOMXML:-OFF} \
DOMXSLT "DOM XSLT and EXSLT support (implies DOMXML)" ${WITH_DOMXSLT:-OFF} \
EXIF "EXIF support" ${WITH_EXIF:-OFF} \
FILEPRO "filePro support" ${WITH_FILEPRO:-OFF} \
+FRIBIDI "FriBidi support" ${WITH_FRIBIDI:-OFF} \
FTP "FTP support" ${WITH_FTP:-OFF} \
GD "GD library support" ${WITH_GD:-OFF} \
GDBM "GDBM database support (dba)" ${WITH_GDBM:-OFF} \
diff --git a/lang/php4/scripts/php4_options b/lang/php4/scripts/php4_options
index dcf95fc3a0f2..2774596d3f85 100644
--- a/lang/php4/scripts/php4_options
+++ b/lang/php4/scripts/php4_options
@@ -11,6 +11,7 @@ WITH_DOMXML=OFF
WITH_DOMXSLT=OFF
WITH_EXIF=OFF
WITH_FILEPRO=OFF
+WITH_FRIBIDI=OFF
WITH_FTP=OFF
WITH_GD=OFF
WITH_GDBM=OFF