summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-04-16 00:09:45 +0300
committerDmitry Stogov <dmitry@zend.com>2019-04-16 00:09:45 +0300
commit10aeed5be4da5344768f0cab9b1e46c756277efe (patch)
tree88c7191236940fd2ab37943c6feefcdd4a9c2ff6
parent3f7bf35e169556f441e5840909261f1677fff640 (diff)
parent68842534616cd0ab29af4c1b8966c4ebf9900c2c (diff)
downloadphp-git-10aeed5be4da5344768f0cab9b1e46c756277efe.tar.gz
Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
* 'PHP-7.4' of git.php.net:php-src: Remove not needed extension generated files gitignores Add test for curl_version() Fixed bug #77895 Zero sockaddr struct Fix saproxy_property_write signature Correctly destroy reference in ArrayObject sort
-rw-r--r--.gitignore4
-rw-r--r--ext/com_dotnet/com_saproxy.c3
-rw-r--r--ext/curl/tests/curl_version_basic_001.phpt31
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp2
-rw-r--r--ext/intl/tests/bug77895.phpt13
-rw-r--r--ext/spl/spl_array.c3
-rw-r--r--main/network.c2
7 files changed, 51 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index ca7179b7b0..d98d59afd4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -179,11 +179,7 @@ php
# ------------------------------------------------------------------------------
/ext/*/acinclude.m4
/ext/*/build/
-/ext/*/config.guess
-/ext/*/config.sub
/ext/*/configure.ac
-/ext/*/ltmain.sh
-/ext/*/Makefile.global
/ext/*/run-tests.php
# ------------------------------------------------------------------------------
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 7eec446a3f..15f68367c4 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -78,9 +78,10 @@ static zval *saproxy_property_read(zval *object, zval *member, int type, void **
return rv;
}
-static void saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot)
+static zval *saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
php_com_throw_exception(E_INVALIDARG, "safearray has no properties");
+ return value;
}
static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *rv)
diff --git a/ext/curl/tests/curl_version_basic_001.phpt b/ext/curl/tests/curl_version_basic_001.phpt
new file mode 100644
index 0000000000..803e9f689d
--- /dev/null
+++ b/ext/curl/tests/curl_version_basic_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Test curl_version() basic functionality
+--SKIPIF--
+<?php
+ if (!extension_loaded("curl")) {
+ exit("skip curl extension not loaded");
+ }
+?>
+--FILE--
+<?php
+ $info_curl = curl_version();
+ var_dump($info_curl["version_number"]);
+ var_dump($info_curl["age"]);
+ var_dump($info_curl["features"]);
+ var_dump($info_curl["ssl_version_number"]);
+ var_dump($info_curl["version"]);
+ var_dump($info_curl["host"]);
+ var_dump($info_curl["ssl_version"]);
+ var_dump($info_curl["libz_version"]);
+ var_dump(array_key_exists("protocols", $info_curl));
+?>
+--EXPECTF--
+int(%i)
+int(%i)
+int(%i)
+int(%i)
+string(%i) "%s"
+string(%i) "%s"
+string(%i) "%s"
+string(%i) "%s"
+bool(true)
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index 9268b9ddf5..8c2b72a2da 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -70,7 +70,7 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
intl_error_reset(NULL);
object = return_value;
/* Parse parameters. */
- if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs",
+ if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "s!ll|zzs",
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
diff --git a/ext/intl/tests/bug77895.phpt b/ext/intl/tests/bug77895.phpt
new file mode 100644
index 0000000000..18b4f778e6
--- /dev/null
+++ b/ext/intl/tests/bug77895.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #77895: IntlDateFormatter::create fails in strict mode if $locale = null
+--FILE--
+<?php
+
+declare(strict_types=1);
+
+var_dump(IntlDateFormatter::create(null, IntlDateFormatter::NONE, IntlDateFormatter::NONE));
+
+?>
+--EXPECT--
+object(IntlDateFormatter)#1 (0) {
+}
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 2806f93281..284bb71c81 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1470,7 +1470,8 @@ exit:
} else {
GC_DELREF(aht);
}
- efree(Z_REF(params[0]));
+ ZVAL_NULL(Z_REFVAL(params[0]));
+ zval_ptr_dtor(&params[0]);
zend_string_free(Z_STR(function_name));
}
} /* }}} */
diff --git a/main/network.c b/main/network.c
index 60ce19f9df..29b98ae69e 100644
--- a/main/network.c
+++ b/main/network.c
@@ -515,6 +515,8 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_lo
struct sockaddr_in6 *in6 = (struct sockaddr_in6*)sa;
#endif
+ memset(sa, 0, sizeof(struct sockaddr));
+
if (*addr == '[') {
colon = memchr(addr + 1, ']', addrlen-1);
if (!colon || colon[1] != ':') {