summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-25 10:52:46 +0800
committerXinchen Hui <laruence@php.net>2014-07-25 10:52:46 +0800
commitbad5502ca9b2bf3d6e9f4583a343a09fc862c0f6 (patch)
tree3d67b227529960236f8ad6707bab5949970bf09f
parent235d0241d1264085c2e24b0ed02d1fdff35b2313 (diff)
parent8d1ec3814e1b3f00a7afe2f32e2989121b3ae647 (diff)
downloadphp-git-bad5502ca9b2bf3d6e9f4583a343a09fc862c0f6.tar.gz
Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6
-rw-r--r--NEWS3
-rw-r--r--Zend/tests/constant_expressions_self_referencing_array.phpt2
-rw-r--r--Zend/zend_ast.c17
-rw-r--r--Zend/zend_vm_def.h11
-rw-r--r--Zend/zend_vm_execute.h11
-rw-r--r--ext/openssl/xp_ssl.c2
-rw-r--r--ext/reflection/php_reflection.c13
-rw-r--r--main/rfc1867.c1
8 files changed, 49 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index b5ca27adb0..122e05ec1c 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ PHP NEWS
- FPM:
. Fixed bug #67530 (error_log=syslog ignored). (Remi)
+ . Fixed bug #67635 (php links to systemd libraries without using pkg-config).
+ (pacho@gentoo.org, Remi)
- Intl:
. Fixed bug #66921 (Wrong argument type hint for function
@@ -34,6 +36,7 @@ PHP NEWS
. Fixed bug #67609 (TLS connections fail behind HTTP proxy). (Daniel Lowrey)
. Fixed broken build against OpenSSL older than 0.9.8 where ECDH unavailable.
(Lior Kaplan)
+ . Fixed bug #67666 (Subject altNames doesn't support wildcard matching). (Tjerk)
- Phar:
. Fixed bug #67587 (Redirection loop on nginx with FPM). (Christian Weiske)
diff --git a/Zend/tests/constant_expressions_self_referencing_array.phpt b/Zend/tests/constant_expressions_self_referencing_array.phpt
index 09f862e048..ae76a08602 100644
--- a/Zend/tests/constant_expressions_self_referencing_array.phpt
+++ b/Zend/tests/constant_expressions_self_referencing_array.phpt
@@ -1,7 +1,5 @@
--TEST--
Self-referencing constant expression (part of a constant AST)
---XFAIL--
-Not yet fixed, to be fixed for PHP 5.6
--FILE--
<?php
class A {
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 12f9405523..a7df0adbab 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -251,10 +251,19 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
zval_dtor(&op2);
break;
case ZEND_CONST:
- *result = *ast->u.val;
- zval_copy_ctor(result);
- if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) {
- zval_update_constant_ex(&result, 1, scope TSRMLS_CC);
+ /* class constants may be updated in-place */
+ if (scope) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val))) {
+ zval_update_constant_ex(&ast->u.val, 1, scope TSRMLS_CC);
+ }
+ *result = *ast->u.val;
+ zval_copy_ctor(result);
+ } else {
+ *result = *ast->u.val;
+ zval_copy_ctor(result);
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) {
+ zval_update_constant_ex(&result, 1, scope TSRMLS_CC);
+ }
}
break;
case ZEND_BOOL_AND:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 117e42b3be..cadaaa7579 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -5387,7 +5387,16 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
c.value = *tmp_ptr;
} else {
INIT_PZVAL_COPY(&c.value, val);
- zval_copy_ctor(&c.value);
+ if (Z_TYPE(c.value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL(c.value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL(c.value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL(c.value) = ht;
+ } else {
+ zval_copy_ctor(&c.value);
+ }
}
c.flags = CONST_CS; /* non persistent, case sensetive */
c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 144930e254..c085276a33 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -4323,7 +4323,16 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
c.value = *tmp_ptr;
} else {
INIT_PZVAL_COPY(&c.value, val);
- zval_copy_ctor(&c.value);
+ if (Z_TYPE(c.value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL(c.value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL(c.value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL(c.value) = ht;
+ } else {
+ zval_copy_ctor(&c.value);
+ }
}
c.flags = CONST_CS; /* non persistent, case sensetive */
c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 948bb14ebe..03a84bf363 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -321,7 +321,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC
if (san_name_len != strlen((const char*)cert_name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer SAN entry is malformed");
} else {
- is_match = strcasecmp(subject_name, (const char*)cert_name) == 0;
+ is_match = matches_wildcard_name(subject_name, (const char *)cert_name);
}
OPENSSL_free(cert_name);
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 703e14113f..02a19c0aaa 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -728,12 +728,17 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {
zval *zv, zv_copy;
int use_copy;
+ zend_class_entry *old_scope;
+
string_write(str, " = ", sizeof(" = ")-1);
ALLOC_ZVAL(zv);
*zv = *precv->op2.zv;
zval_copy_ctor(zv);
INIT_PZVAL(zv);
- zval_update_constant_ex(&zv, 1, fptr->common.scope TSRMLS_CC);
+ old_scope = EG(scope);
+ EG(scope) = fptr->common.scope;
+ zval_update_constant_ex(&zv, 1, NULL TSRMLS_CC);
+ EG(scope) = old_scope;
if (Z_TYPE_P(zv) == IS_BOOL) {
if (Z_LVAL_P(zv)) {
string_write(str, "true", sizeof("true")-1);
@@ -2579,6 +2584,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
{
parameter_reference *param;
zend_op *precv;
+ zend_class_entry *old_scope;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -2599,7 +2605,10 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
if (!IS_CONSTANT_TYPE(Z_TYPE_P(return_value))) {
zval_copy_ctor(return_value);
}
- zval_update_constant_ex(&return_value, 0, param->fptr->common.scope TSRMLS_CC);
+ old_scope = EG(scope);
+ EG(scope) = param->fptr->common.scope;
+ zval_update_constant_ex(&return_value, 0, NULL TSRMLS_CC);
+ EG(scope) = old_scope;
}
/* }}} */
diff --git a/main/rfc1867.c b/main/rfc1867.c
index c93472f5a1..806a292872 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -36,6 +36,7 @@
#if defined(PHP_WIN32) && !defined(HAVE_ATOLL)
# define atoll(s) _atoi64(s)
+# define HAVE_ATOLL 1
#endif
#define DEBUG_FILE_UPLOAD ZEND_DEBUG