From a8e0a623ecdfa90027570faa921001a65092310f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 18 Jul 2014 11:35:32 +0200 Subject: [PATCH 1/7] fix file with zero size usage in phpize mode --- win32/build/phpize.js.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/win32/build/phpize.js.in b/win32/build/phpize.js.in index 3178804212e..c99dece6181 100644 --- a/win32/build/phpize.js.in +++ b/win32/build/phpize.js.in @@ -40,9 +40,13 @@ function ERROR(msg) function file_get_contents(filename) { + var t = ""; var F = FSO.OpenTextFile(filename, 1); - var t = F.ReadAll(); - F.Close(); + + if (!F.AtEndOfStream) { + t = F.ReadAll(); + F.Close(); + } return t; } From 8044d0680ba03a08b5d4daa61e6b0b20d1ac30c0 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 18 Jul 2014 11:36:44 +0200 Subject: [PATCH 2/7] fix default prefix in phpize mode --- win32/build/config.w32.phpize.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index b8bf45ea577..a544aac85c4 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -105,6 +105,11 @@ if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") { ERROR("Use of both --enable-debug and --enable-debug-pack not allowed."); } +if (PHP_PREFIX == '') { + PHP_PREFIX = "C:\\php"; + if (PHP_DEBUG == "yes") + PHP_PREFIX += "\\debug"; +} DEFINE('PHP_PREFIX', PHP_PREFIX); DEFINE("BASE_INCLUDES", "/I " + PHP_DIR + "/include /I " + PHP_DIR + "/include/main /I " + PHP_DIR + "/include/Zend /I " + PHP_DIR + "/include/TSRM /I " + PHP_DIR + "/include/ext "); From 35b077f53e0f8a1debc8bbacf1328b40c62099ab Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 18 Jul 2014 11:39:38 +0200 Subject: [PATCH 3/7] fix copy the ext dll into the prefix path in phpize mode --- win32/build/confutils.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 1c61316fb96..3de57a9963e 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1347,9 +1347,6 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) if (MODE_PHPIZE && FSO.FileExists(PHP_DIR + "/include/main/config.pickle.h")) { cflags = "/FI main/config.pickle.h " + cflags; } - if (MODE_PHPIZE && FSO.FileExists(PHP_DIR + "/include/main/config.pickle.h")) { - cflags = "/FI main/config.pickle.h " + cflags; - } ADD_FLAG("CFLAGS_" + EXT, cflags); if (PHP_DSP != "no") { @@ -1869,6 +1866,7 @@ function generate_phpize() var MF = FSO.CreateTextFile(dest + "/phpize.js", true); var DEPS = FSO.CreateTextFile(dest + "/ext_deps.js", true); + prefix = get_define("PHP_PREFIX"); prefix = prefix.replace(new RegExp("/", "g"), "\\"); prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\"); @@ -1955,7 +1953,7 @@ function generate_makefile() var lib = "php_" + extensions_enabled[i][0] + ".lib"; var dll = "php_" + extensions_enabled[i][0] + ".dll"; MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib\\" + lib); - //MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)\\" + dll); + MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)\\" + dll); } } TF.Close(); From c5ccaf1d04fe20dc117b81764041c47efcb9b156 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 18 Jul 2014 18:38:57 +0200 Subject: [PATCH 4/7] implemented copy libs of core exts in phpize mode --- win32/build/Makefile | 2 +- win32/build/confutils.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/win32/build/Makefile b/win32/build/Makefile index e2d62545b8c..53cb52adaf4 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -183,7 +183,7 @@ msi-installer: dist # need to redirect, since INSTALL is a file in the root... install: really-install install-sdk -build-lib: +build-lib: build-ext-libs @if not exist $(BUILD_DIR_DEV)\lib mkdir $(BUILD_DIR_DEV)\lib >nul @copy $(BUILD_DIR)\$(PHPLIB) $(BUILD_DIR_DEV)\lib /y >nul diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3de57a9963e..5a13494fc09 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1952,8 +1952,18 @@ function generate_makefile() for (var i in extensions_enabled) { var lib = "php_" + extensions_enabled[i][0] + ".lib"; var dll = "php_" + extensions_enabled[i][0] + ".dll"; - MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib\\" + lib); - MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)\\" + dll); + MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib"); + MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)"); + } + } else { + MF.WriteBlankLines(1); + MF.WriteLine("build-ext-libs:"); + for (var i in extensions_enabled) { + var lib = "php_" + extensions_enabled[i][0] + ".lib"; + + if ('shared' == extensions_enabled[i][1]) { + MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib"); + } } } TF.Close(); From e946de29d2f337f140780086b0ccefd13e2095ef Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Sat, 19 Jul 2014 09:52:01 +0900 Subject: [PATCH 5/7] Fixed bug #66827 Session raises E_NOTICE when session name variable is array --- ext/session/session.c | 22 +++++++++++++--------- ext/session/tests/bug66827.phpt | 12 ++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 ext/session/tests/bug66827.phpt diff --git a/ext/session/session.c b/ext/session/session.c index 74a7f4a1da7..7d145c362b4 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1327,9 +1327,16 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{ } /* }}} */ -#define PPID2SID \ - convert_to_string((*ppid)); \ - PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid)) +static void ppid2sid(zval **ppid TSRMLS_DC) { + if (Z_TYPE_PP(ppid) != IS_STRING) { + PS(id) = NULL; + PS(send_cookie) = 1; + } else { + convert_to_string((*ppid)); + PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid)); + PS(send_cookie) = 0; + } +} static void php_session_reset_id(TSRMLS_D) /* {{{ */ { @@ -1418,9 +1425,8 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ Z_TYPE_PP(data) == IS_ARRAY && zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS ) { - PPID2SID; + ppid2sid(ppid TSRMLS_CC); PS(apply_trans_sid) = 0; - PS(send_cookie) = 0; PS(define_sid) = 0; } @@ -1429,8 +1435,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ Z_TYPE_PP(data) == IS_ARRAY && zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS ) { - PPID2SID; - PS(send_cookie) = 0; + ppid2sid(ppid TSRMLS_CC); } if (!PS(use_only_cookies) && !PS(id) && @@ -1438,8 +1443,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ Z_TYPE_PP(data) == IS_ARRAY && zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS ) { - PPID2SID; - PS(send_cookie) = 0; + ppid2sid(ppid TSRMLS_CC); } } diff --git a/ext/session/tests/bug66827.phpt b/ext/session/tests/bug66827.phpt new file mode 100644 index 00000000000..4e1a4f7aea6 --- /dev/null +++ b/ext/session/tests/bug66827.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #66827: Session raises E_NOTICE when session name variable is array. +--INI-- +--SKIPIF-- + +--FILE-- + Date: Sat, 19 Jul 2014 10:12:28 +0900 Subject: [PATCH 6/7] Update NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 44c09d0d7d5..98d6efc5485 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,10 @@ PHP NEWS - Streams: . Fixed bug #67430 (http:// wrapper doesn't follow 308 redirects). (Adam) +- Session: + . Fixed bug #66827 (Session raises E_NOTICE when session name variable is array). + (Yasuo) + 27 Jun 2014, PHP 5.5.14 - Core: From f604b61e39fb0807a4e0668e62a8527d4672a26f Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 19 Jul 2014 12:53:34 +0800 Subject: [PATCH 7/7] New added opcodes don't need to be resloved --- Zend/zend_opcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index cd810ec36f7..80ec632f50e 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -625,10 +625,10 @@ static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint op_num TSR static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC) { - zend_uint i; + zend_uint i, j; zend_op *opline; - for (i = 0; i < op_array->last; i++) { + for (i = 0, j = op_array->last; i < j; i++) { opline = op_array->opcodes + i; switch (opline->opcode) { case ZEND_RETURN: