diff --git a/NEWS b/NEWS index b5ca27adb0b..122e05ec1c0 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 09f862e0487..ae76a086022 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-- 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 117e42b3be0..cadaaa75797 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 144930e254b..c085276a332 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 948bb14ebea..03a84bf363a 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 703e14113f0..02a19c0aaab 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 c93472f5a12..806a292872a 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