From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jun 22 03:00:31 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2759437B401 for ; Sun, 22 Jun 2003 03:00:31 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2F7D43FCB for ; Sun, 22 Jun 2003 03:00:29 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5MA0TUp070339 for ; Sun, 22 Jun 2003 03:00:29 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5MA0To3070338; Sun, 22 Jun 2003 03:00:29 -0700 (PDT) Resent-Date: Sun, 22 Jun 2003 03:00:29 -0700 (PDT) Resent-Message-Id: <200306221000.h5MA0To3070338@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Dupre Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B228437B401; Sun, 22 Jun 2003 02:50:13 -0700 (PDT) Received: from vaio.alexdupre.com (ppp-89-27.24-151.libero.it [151.24.27.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id C717D43FA3; Sun, 22 Jun 2003 02:50:10 -0700 (PDT) (envelope-from alex@vaio.alexdupre.com) Received: from vaio.alexdupre.com (localhost [127.0.0.1]) by vaio.alexdupre.com (8.12.9/8.12.9) with ESMTP id h5M9o7Lo040317; Sun, 22 Jun 2003 11:50:07 +0200 (CEST) (envelope-from alex@vaio.alexdupre.com) Received: (from alex@localhost) by vaio.alexdupre.com (8.12.9/8.12.9/Submit) id h5M9o5Qt040316; Sun, 22 Jun 2003 11:50:05 +0200 (CEST) Message-Id: <200306220950.h5M9o5Qt040316@vaio.alexdupre.com> Date: Sun, 22 Jun 2003 11:50:05 +0200 (CEST) From: Alex Dupre To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: nork@FreeBSD.org Subject: ports/53609: [Maintainer Update] Port: lang/php4 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alex Dupre List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2003 10:00:31 -0000 >Number: 53609 >Category: ports >Synopsis: [Maintainer Update] Port: lang/php4 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Jun 22 03:00:29 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Alex Dupre >Release: FreeBSD 4.8-ALEXDUPRE i386 >Organization: >Environment: System: FreeBSD 4.8-ALEXDUPRE i386 >Description: Add FriBiDi extension (patch by Thierry Thomas). New patch-main::main.c file (requested by Ian Service): - 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. >How-To-Repeat: >Fix: --- php4.diff begins here --- diff -ruN php4.orig/Makefile php4/Makefile --- php4.orig/Makefile Sun Jun 22 11:22:28 2003 +++ php4/Makefile Sun Jun 22 11:44:01 2003 @@ -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 @@ .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}) @@ -274,6 +275,11 @@ .if defined(WITH_FILEPRO) 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) diff -ruN php4.orig/files/patch-main::main.c php4/files/patch-main::main.c --- php4.orig/files/patch-main::main.c Thu Jan 1 01:00:00 1970 +++ php4/files/patch-main::main.c Sun Jun 22 11:18:12 2003 @@ -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; irefcount+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 -ruN php4.orig/scripts/configure.php php4/scripts/configure.php --- php4.orig/scripts/configure.php Sun Jun 22 11:22:28 2003 +++ php4/scripts/configure.php Sun Jun 22 11:27:24 2003 @@ -31,6 +31,7 @@ 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 -ruN php4.orig/scripts/php4_options php4/scripts/php4_options --- php4.orig/scripts/php4_options Sun Jun 22 11:22:28 2003 +++ php4/scripts/php4_options Sun Jun 22 11:22:49 2003 @@ -11,6 +11,7 @@ WITH_DOMXSLT=OFF WITH_EXIF=OFF WITH_FILEPRO=OFF +WITH_FRIBIDI=OFF WITH_FTP=OFF WITH_GD=OFF WITH_GDBM=OFF --- php4.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: