From c2c60fcac75d74a5c6864af2723301c72cb73925 Mon Sep 17 00:00:00 2001 From: Lior Kaplan Date: Thu, 13 Jul 2017 18:05:47 +0300 Subject: [PATCH 01/13] SIZEOF_SIZE_T doesn't exist on AIX and POWER8 (ppc64le), keep using SIZEOF_LONG --- ext/mbstring/oniguruma/src/regint.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/mbstring/oniguruma/src/regint.h b/ext/mbstring/oniguruma/src/regint.h index c33bc4e261d..4c9853b39dc 100644 --- a/ext/mbstring/oniguruma/src/regint.h +++ b/ext/mbstring/oniguruma/src/regint.h @@ -201,7 +201,11 @@ } while(0) /* sizeof(OnigCodePoint) */ -#define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T +#ifdef SIZEOF_SIZE_T +# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T +#else +# define WORD_ALIGNMENT_SIZE SIZEOF_LONG +#endif #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\ (pad_size) = WORD_ALIGNMENT_SIZE \ From 1e2764614bc8dca9ef44082d0a1e53d09f8b0562 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Jul 2017 17:34:14 +0200 Subject: [PATCH 02/13] add oniguruma.patch to ease future upgrades --- .gitignore | 5 +++ ext/mbstring/oniguruma.patch | 61 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 ext/mbstring/oniguruma.patch diff --git a/.gitignore b/.gitignore index 77189e32ca8..13d0a26b704 100644 --- a/.gitignore +++ b/.gitignore @@ -229,3 +229,8 @@ win32/wsyslog.h **/tests/**/*.db **/tests/**/*.txt **/tests/**/*.tmp + +# special cases to invert previous ignore rules +!ext/fileinfo/libmagic.patch +!ext/mbstring/oniguruma.patch + diff --git a/ext/mbstring/oniguruma.patch b/ext/mbstring/oniguruma.patch new file mode 100644 index 00000000000..7c21f622fbf --- /dev/null +++ b/ext/mbstring/oniguruma.patch @@ -0,0 +1,61 @@ +diff -wur oniguruma.orig/src/config.h.win32 oniguruma/src/config.h.win32 +--- oniguruma.orig/src/config.h.win32 2017-07-13 17:12:45.228068900 +0200 ++++ oniguruma/src/config.h.win32 2017-07-13 16:11:19.955226200 +0200 +@@ -15,6 +15,7 @@ + #define SIZEOF_VOIDP 4 + #define SIZEOF_FLOAT 4 + #define SIZEOF_DOUBLE 8 ++#define SIZEOF_SIZE_T 4 + #define HAVE_PROTOTYPES 1 + #define TOKEN_PASTE(x,y) x##y + #define HAVE_STDARG_PROTOTYPES 1 +diff -wur oniguruma.orig/src/config.h.win64 oniguruma/src/config.h.win64 +--- oniguruma.orig/src/config.h.win64 2017-07-13 17:12:45.273605000 +0200 ++++ oniguruma/src/config.h.win64 2017-07-13 16:11:19.957231300 +0200 +@@ -15,6 +15,7 @@ + #define SIZEOF_VOIDP 8 + #define SIZEOF_FLOAT 4 + #define SIZEOF_DOUBLE 8 ++#define SIZEOF_SIZE_T 8 + #define HAVE_PROTOTYPES 1 + #define TOKEN_PASTE(x,y) x##y + #define HAVE_STDARG_PROTOTYPES 1 +diff -wur oniguruma.orig/src/regint.h oniguruma/src/regint.h +--- oniguruma.orig/src/regint.h 2017-07-13 17:12:48.686073300 +0200 ++++ oniguruma/src/regint.h 2017-07-13 17:13:28.032286100 +0200 +@@ -201,17 +201,21 @@ + } while(0) + + /* sizeof(OnigCodePoint) */ ++#ifdef SIZEOF_SIZE_T ++# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T ++#else + #define WORD_ALIGNMENT_SIZE SIZEOF_LONG ++#endif + + #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\ + (pad_size) = WORD_ALIGNMENT_SIZE \ +- - ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\ ++ - ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\ + if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\ + } while (0) + + #define ALIGNMENT_RIGHT(addr) do {\ + (addr) += (WORD_ALIGNMENT_SIZE - 1);\ +- (addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\ ++ (addr) -= ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\ + } while (0) + + #endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ +@@ -662,7 +666,11 @@ + BBuf* mbuf; /* multi-byte info or NULL */ + } CClassNode; + ++#ifdef _WIN64 ++typedef __int64 OnigStackIndex; ++#else + typedef long OnigStackIndex; ++#endif + + typedef struct _OnigStackType { + unsigned int type; From 850bb998d9664e849ed743ea031dd0ee2a64cc9d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Jul 2017 18:36:00 +0200 Subject: [PATCH 03/13] Enable valgrind support for PCRE by default in debug builds Thanks Nikita for the hint. --- ext/pcre/config0.m4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4 index 6d5b2577911..aa8cd304e09 100644 --- a/ext/pcre/config0.m4 +++ b/ext/pcre/config0.m4 @@ -79,11 +79,14 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality] fi PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR - Enable PCRE valgrind support. Developers only!], no, no) + Enable PCRE valgrind support. Developers only!], $PHP_DEBUG, no) + if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then AC_MSG_WARN([PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect]) else - if test "$PHP_PCRE_VALGRIND" != "no"; then + if test "$PHP_PCRE_VALGRIND" = "no" && test "$PHP_DEBUG" != "no"; then + AC_MSG_NOTICE([PCRE Valgrind support is disabled for debug build]) + elif test "$PHP_PCRE_VALGRIND" != "no" || test "$PHP_DEBUG" != "no"; then PHP_PCRE_VALGRIND_INCDIR= AC_MSG_CHECKING([for Valgrind headers location]) for i in $PHP_PCRE_VALGRIND $PHP_PCRE_VALGRIND/include $PHP_PCRE_VALGRIND/local/include /usr/include /usr/local/include; do From 24de0fe9f4f92178adba27e2f1353e97a956b4a8 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Jul 2017 20:28:10 +0200 Subject: [PATCH 04/13] fix default args for --with-pcre-valgrind --- ext/pcre/config0.m4 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4 index aa8cd304e09..cc9f1b262ae 100644 --- a/ext/pcre/config0.m4 +++ b/ext/pcre/config0.m4 @@ -78,15 +78,20 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality] fi fi -PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR - Enable PCRE valgrind support. Developers only!], $PHP_DEBUG, no) + if test "$PHP_DEBUG" != "no" && test "$PHP_DEBUG" != "0"; then + PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR + Enable PCRE valgrind support. Developers only!], yes, no) + else + PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR + Enable PCRE valgrind support. Developers only!], no, no) + fi if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then AC_MSG_WARN([PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect]) else - if test "$PHP_PCRE_VALGRIND" = "no" && test "$PHP_DEBUG" != "no"; then + if test "$PHP_PCRE_VALGRIND" = "no" && test "$PHP_DEBUG" != "0"; then AC_MSG_NOTICE([PCRE Valgrind support is disabled for debug build]) - elif test "$PHP_PCRE_VALGRIND" != "no" || test "$PHP_DEBUG" != "no"; then + elif test "$PHP_PCRE_VALGRIND" != "no" || test "$PHP_DEBUG" != "0"; then PHP_PCRE_VALGRIND_INCDIR= AC_MSG_CHECKING([for Valgrind headers location]) for i in $PHP_PCRE_VALGRIND $PHP_PCRE_VALGRIND/include $PHP_PCRE_VALGRIND/local/include /usr/include /usr/local/include; do From 9ce076a3d12bab14a5e483eee3082363acd567e6 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Jul 2017 20:28:44 +0200 Subject: [PATCH 05/13] disable --with-pcre-valgrind on travis --- travis/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/compile.sh b/travis/compile.sh index ddf80f994d6..b2d29b99df6 100755 --- a/travis/compile.sh +++ b/travis/compile.sh @@ -5,7 +5,7 @@ else TS=""; fi if [[ "$ENABLE_DEBUG" == 1 ]]; then - DEBUG="--enable-debug"; + DEBUG="--enable-debug --without-pcre-valgrind"; else DEBUG=""; fi From 89eb27a99cdf7e7b7876c12e42f7ff35760eb40a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Jul 2017 21:08:13 +0200 Subject: [PATCH 06/13] update NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index ea7e10bbb9a..598edb21f66 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS php_parse_date()). (Derick) . Fixed bug #49649 (unserialize() doesn't handle changes in property visibility). (pmmaga) + . Fixed #74866 (extension_dir = "./ext" now use current directory for base). + (Francois Laupretre) - Date: . Fixed bug #74852 (property_exists returns true on unknown DateInterval From 9cf586cdfb6385753e477dbe8b2db11501c3a960 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 14 Jul 2017 01:12:00 +0200 Subject: [PATCH 07/13] Fix compile error with EXIF_DEBUG --- ext/exif/exif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 17c524f3314..63b23d2f8cd 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -4590,7 +4590,7 @@ PHP_FUNCTION(exif_read_data) exif_discard_imageinfo(&ImageInfo); #ifdef EXIF_DEBUG - php_error_docref1(NULL, p_name, E_NOTICE, "done"); + php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "" : Z_STRVAL_P(stream)), E_NOTICE, "Done"); #endif } /* }}} */ @@ -4672,7 +4672,7 @@ PHP_FUNCTION(exif_thumbnail) exif_discard_imageinfo(&ImageInfo); #ifdef EXIF_DEBUG - php_error_docref1(NULL, p_name, E_NOTICE, "Done"); + php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "" : Z_STRVAL_P(stream)), E_NOTICE, "Done"); #endif } /* }}} */ From bf7f6f9078b535ffa70808d9700d7bed121b230d Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 14 Jul 2017 01:17:34 +0200 Subject: [PATCH 08/13] Don't add a new line to undefined tags in EXIF_DEBUG mode --- ext/exif/exif.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 63b23d2f8cd..cc42abd5bff 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -49,6 +49,8 @@ */ #undef EXIF_DEBUG +#define EXIF_DEBUG 1 + #ifdef EXIF_DEBUG #define EXIFERR_DC , const char *_file, size_t _line #define EXIFERR_CC , __FILE__, __LINE__ @@ -1552,7 +1554,7 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in return value_ptr ? value_ptr : ""; } if (format == TAG_FMT_UNDEFINED) { - return "\n"; + return ""; } if (format == TAG_FMT_IFD) { return ""; From f7d9f6456ccba63cbf582d2269cfcaa3da9600f4 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 14 Jul 2017 01:18:58 +0200 Subject: [PATCH 09/13] Turn off EXIF_DEBUG so Travis don't complain at me --- ext/exif/exif.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index cc42abd5bff..75583742917 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -49,8 +49,6 @@ */ #undef EXIF_DEBUG -#define EXIF_DEBUG 1 - #ifdef EXIF_DEBUG #define EXIFERR_DC , const char *_file, size_t _line #define EXIFERR_CC , __FILE__, __LINE__ From 997e2e5452140fe10ea917d445d33b16a9a84681 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 14 Jul 2017 01:59:23 +0200 Subject: [PATCH 10/13] Ensure that the stream position is kept between reads --- ext/exif/exif.c | 25 +++++++++++++++++-- .../tests/exif_read_data_streams_seek.phpt | 21 ++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 ext/exif/tests/exif_read_data_streams_seek.phpt diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 75583742917..9ac323e1d63 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -4305,9 +4305,9 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo) } /* }}} */ -/* {{{ exif_read_from_stream +/* {{{ exif_read_from_impl */ -static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all) +static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all) { int ret; zend_stat_t st; @@ -4368,6 +4368,27 @@ static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, } /* }}} */ +/* {{{ exif_read_from_stream + */ +static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all) +{ + int ret; + off_t old_pos = php_stream_tell(stream); + + if (old_pos) { + php_stream_seek(stream, 0, SEEK_SET); + } + + ret = exif_read_from_impl(ImageInfo, stream, read_thumbnail, read_all); + + if (old_pos) { + php_stream_seek(stream, old_pos, SEEK_SET); + } + + return ret; +} +/* }}} */ + /* {{{ exif_read_from_file */ static int exif_read_from_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all) diff --git a/ext/exif/tests/exif_read_data_streams_seek.phpt b/ext/exif/tests/exif_read_data_streams_seek.phpt new file mode 100644 index 00000000000..e3b2c99e455 --- /dev/null +++ b/ext/exif/tests/exif_read_data_streams_seek.phpt @@ -0,0 +1,21 @@ +--TEST-- +exif_read_data() with streams test +--SKIPIF-- + +--INI-- +output_handler= +zlib.output_compression=0 +--FILE-- + +--EXPECT-- +bool(true) From 333c36217846e2b76a872008b85b61318ac6f18c Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 14 Jul 2017 02:02:25 +0200 Subject: [PATCH 11/13] Fix test title --- ext/exif/tests/exif_read_data_streams_seek.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/exif/tests/exif_read_data_streams_seek.phpt b/ext/exif/tests/exif_read_data_streams_seek.phpt index e3b2c99e455..a9476b43533 100644 --- a/ext/exif/tests/exif_read_data_streams_seek.phpt +++ b/ext/exif/tests/exif_read_data_streams_seek.phpt @@ -1,5 +1,5 @@ --TEST-- -exif_read_data() with streams test +exif_read_data() with streams seeking test --SKIPIF-- --INI-- From 4d684a6cd79a4de090343e1ff913cc6f50cd0932 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Fri, 14 Jul 2017 03:42:15 +0200 Subject: [PATCH 12/13] WS --- ext/exif/exif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 9ac323e1d63..adfb539b372 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3723,7 +3723,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo) unsigned int ll, lh; uchar *Data; size_t fpos, size, got, itemlen; - jpeg_sof_info sof_info; + jpeg_sof_info sof_info; for(section=0;;section++) { #ifdef EXIF_DEBUG From c1504b81d35da5630cab32d57f4d3faa0bf3aaa1 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 14 Jul 2017 14:13:08 +1000 Subject: [PATCH 13/13] Bump OCI8 version for recent patch --- ext/oci8/package.xml | 21 ++++++++++++++++++--- ext/oci8/php_oci8.h | 2 +- ext/oci8/tests/driver_name.phpt | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 15109c2bf38..450777bcf74 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -50,8 +50,8 @@ Interoperability Support" (ID 207303.1) for details. - 2.1.5 - 2.1.5 + 2.1.6 + 2.1.6 stable @@ -60,7 +60,6 @@ Interoperability Support" (ID 207303.1) for details. PHP This version is for PHP 7 only. -Added TAF callback support (PR #2459, KoenigsKind) Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge) @@ -471,6 +470,22 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge) + + + 2.1.5 + 2.1.5 + + + stable + stable + + PHP + +This version is for PHP 7 only. +Added TAF callback support (PR #2459, KoenigsKind) + + + 2.1.4 diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 8070cb5b8c8..04434f1f68e 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -43,7 +43,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.1.5" +#define PHP_OCI8_VERSION "2.1.6" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/tests/driver_name.phpt b/ext/oci8/tests/driver_name.phpt index a707e88de8d..49616a00ad6 100644 --- a/ext/oci8/tests/driver_name.phpt +++ b/ext/oci8/tests/driver_name.phpt @@ -57,11 +57,11 @@ function get_attr($conn) ?> --EXPECT-- **Test 1.1 - Default values for the attribute ************** -The value of DRIVER_NAME is PHP OCI8 : 2.1.5 +The value of DRIVER_NAME is PHP OCI8 : 2.1.6 ***Test 1.2 - Get the values from different connections ************** Testing with oci_pconnect() -The value of DRIVER_NAME is PHP OCI8 : 2.1.5 +The value of DRIVER_NAME is PHP OCI8 : 2.1.6 Testing with oci_new_connect() -The value of DRIVER_NAME is PHP OCI8 : 2.1.5 +The value of DRIVER_NAME is PHP OCI8 : 2.1.6 Done