summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-19 13:12:26 +0800
committerXinchen Hui <laruence@php.net>2014-07-19 13:12:26 +0800
commit629c1ecd4f6576f801e346de8c593bde116c9372 (patch)
tree124330e22f1aec0a36a4001655f14a97b5124b8f
parentf604b61e39fb0807a4e0668e62a8527d4672a26f (diff)
parent9b30b04b32e16d354f5fc860367a7aecc87dc55b (diff)
downloadphp-git-629c1ecd4f6576f801e346de8c593bde116c9372.tar.gz
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5
-rw-r--r--NEWS4
-rw-r--r--ext/session/session.c22
-rw-r--r--ext/session/tests/bug66827.phpt12
-rw-r--r--win32/build/Makefile2
-rw-r--r--win32/build/config.w32.phpize.in5
-rw-r--r--win32/build/confutils.js18
-rw-r--r--win32/build/phpize.js.in8
7 files changed, 54 insertions, 17 deletions
diff --git a/NEWS b/NEWS
index 44c09d0d7d..98d6efc548 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:
diff --git a/ext/session/session.c b/ext/session/session.c
index 7822ffe59c..eb14e07b65 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1422,9 +1422,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;
+ }
+}
PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
{
@@ -1518,9 +1525,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;
}
@@ -1529,8 +1535,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) &&
@@ -1538,8 +1543,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 0000000000..4e1a4f7aea
--- /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--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$_COOKIE[session_name()] = array();
+session_start();
+echo 'OK';
+--EXPECTF--
+OK
diff --git a/win32/build/Makefile b/win32/build/Makefile
index 057b584549..7a3be93e87 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/config.w32.phpize.in b/win32/build/config.w32.phpize.in
index 7b3b40633b..cfec2a28f1 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 ");
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index c2c322b08c..3cb11f0642 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1362,9 +1362,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") {
@@ -1884,6 +1881,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"), "\\\\");
@@ -1969,8 +1967,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();
diff --git a/win32/build/phpize.js.in b/win32/build/phpize.js.in
index 3178804212..c99dece618 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;
}