From owner-svn-ports-all@freebsd.org Fri Jun 16 14:54:38 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7793CC0AD6A; Fri, 16 Jun 2017 14:54:38 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43BC882EE7; Fri, 16 Jun 2017 14:54:38 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5GEsbcC012320; Fri, 16 Jun 2017 14:54:37 GMT (envelope-from tz@FreeBSD.org) Received: (from tz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5GEsb4I012316; Fri, 16 Jun 2017 14:54:37 GMT (envelope-from tz@FreeBSD.org) Message-Id: <201706161454.v5GEsb4I012316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tz set sender to tz@FreeBSD.org using -f From: Torsten Zuehlsdorff Date: Fri, 16 Jun 2017 14:54:37 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r443708 - in head/lang: php70 php70/files php71 php71/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2017 14:54:38 -0000 Author: tz Date: Fri Jun 16 14:54:36 2017 New Revision: 443708 URL: https://svnweb.freebsd.org/changeset/ports/443708 Log: lang/php70 and lang/php71: Parse multiple [PATH=] and [HOST=] sections properly Adding a patch to fix bug #74738 in PHP 7.0 and 7.1: https://bugs.php.net/bug.php?id=74738 Reported by: Philip Jocks MFH: 2017Q2 Added: head/lang/php70/files/patch-main_php__ini.c (contents, props changed) head/lang/php71/files/patch-main_php__ini.c (contents, props changed) Modified: head/lang/php70/Makefile head/lang/php71/Makefile Modified: head/lang/php70/Makefile ============================================================================== --- head/lang/php70/Makefile Fri Jun 16 14:51:34 2017 (r443707) +++ head/lang/php70/Makefile Fri Jun 16 14:54:36 2017 (r443708) @@ -3,7 +3,7 @@ PORTNAME= php70 PORTVERSION= 7.0.20 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES?= lang devel www MASTER_SITES= PHP/distributions DISTNAME= php-${PORTVERSION} Added: head/lang/php70/files/patch-main_php__ini.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/php70/files/patch-main_php__ini.c Fri Jun 16 14:54:36 2017 (r443708) @@ -0,0 +1,31 @@ +--- main/php_ini.c.orig 2017-06-14 13:27:29 UTC ++++ main/php_ini.c +@@ -280,7 +280,7 @@ static void php_ini_parser_cb(zval *arg1 + size_t key_len; + + /* PATH sections */ +- if (zend_string_equals_literal_ci(Z_STR_P(arg1), "PATH")) { ++ if (!zend_binary_strncasecmp(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), "PATH", sizeof("PATH") - 1, sizeof("PATH") - 1)) { + key = Z_STRVAL_P(arg1); + key = key + sizeof("PATH") - 1; + key_len = Z_STRLEN_P(arg1) - sizeof("PATH") + 1; +@@ -291,7 +291,7 @@ static void php_ini_parser_cb(zval *arg1 + TRANSLATE_SLASHES_LOWER(key); + + /* HOST sections */ +- } else if (zend_string_equals_literal_ci(Z_STR_P(arg1), "HOST")) { ++ } else if (!zend_binary_strncasecmp(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), "HOST", sizeof("HOST") - 1, sizeof("HOST") - 1)) { + key = Z_STRVAL_P(arg1); + key = key + sizeof("HOST") - 1; + key_len = Z_STRLEN_P(arg1) - sizeof("HOST") + 1; +@@ -328,7 +328,9 @@ static void php_ini_parser_cb(zval *arg1 + zend_hash_init(Z_ARRVAL(section_arr), 8, NULL, (dtor_func_t) config_zval_dtor, 1); + entry = zend_hash_str_update(target_hash, key, key_len, §ion_arr); + } +- active_ini_hash = Z_ARRVAL_P(entry); ++ if (Z_TYPE_P(entry) == IS_ARRAY) { ++ active_ini_hash = Z_ARRVAL_P(entry); ++ } + } + } + break; Modified: head/lang/php71/Makefile ============================================================================== --- head/lang/php71/Makefile Fri Jun 16 14:51:34 2017 (r443707) +++ head/lang/php71/Makefile Fri Jun 16 14:54:36 2017 (r443708) @@ -3,7 +3,7 @@ PORTNAME= php71 PORTVERSION= 7.1.6 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES?= lang devel www MASTER_SITES= PHP/distributions DISTNAME= php-${PORTVERSION} Added: head/lang/php71/files/patch-main_php__ini.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/php71/files/patch-main_php__ini.c Fri Jun 16 14:54:36 2017 (r443708) @@ -0,0 +1,40 @@ +--- main/php_ini.c.orig 2017-06-14 13:23:49 UTC ++++ main/php_ini.c +@@ -280,7 +280,7 @@ static void php_ini_parser_cb(zval *arg1 + size_t key_len; + + /* PATH sections */ +- if (zend_string_equals_literal_ci(Z_STR_P(arg1), "PATH")) { ++ if (!zend_binary_strncasecmp(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), "PATH", sizeof("PATH") - 1, sizeof("PATH") - 1)) { + key = Z_STRVAL_P(arg1); + key = key + sizeof("PATH") - 1; + key_len = Z_STRLEN_P(arg1) - sizeof("PATH") + 1; +@@ -291,7 +291,7 @@ static void php_ini_parser_cb(zval *arg1 + TRANSLATE_SLASHES_LOWER(key); + + /* HOST sections */ +- } else if (zend_string_equals_literal_ci(Z_STR_P(arg1), "HOST")) { ++ } else if (!zend_binary_strncasecmp(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), "HOST", sizeof("HOST") - 1, sizeof("HOST") - 1)) { + key = Z_STRVAL_P(arg1); + key = key + sizeof("HOST") - 1; + key_len = Z_STRLEN_P(arg1) - sizeof("HOST") + 1; +@@ -328,7 +328,9 @@ static void php_ini_parser_cb(zval *arg1 + zend_hash_init(Z_ARRVAL(section_arr), 8, NULL, (dtor_func_t) config_zval_dtor, 1); + entry = zend_hash_str_update(target_hash, key, key_len, §ion_arr); + } +- active_ini_hash = Z_ARRVAL_P(entry); ++ if (Z_TYPE_P(entry) == IS_ARRAY) { ++ active_ini_hash = Z_ARRVAL_P(entry); ++ } + } + } + break; +@@ -638,7 +640,7 @@ int php_init_config(void) + } + if (!debpath[0]) { + /* empty string means default builtin value +- to allow "/foo/php.d:" or ":/foo/php.d" */ ++ to allow "/foo/phd.d:" or ":/foo/php.d" */ + debpath = PHP_CONFIG_FILE_SCAN_DIR; + } + lenpath = (int)strlen(debpath);