Skip to content

Commit 10aeed5

Browse files
committed
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
2 parents 3f7bf35 + 6884253 commit 10aeed5

File tree

7 files changed

+51
-7
lines changed

7 files changed

+51
-7
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,7 @@ php
179179
# ------------------------------------------------------------------------------
180180
/ext/*/acinclude.m4
181181
/ext/*/build/
182-
/ext/*/config.guess
183-
/ext/*/config.sub
184182
/ext/*/configure.ac
185-
/ext/*/ltmain.sh
186-
/ext/*/Makefile.global
187183
/ext/*/run-tests.php
188184

189185
# ------------------------------------------------------------------------------

ext/com_dotnet/com_saproxy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ static zval *saproxy_property_read(zval *object, zval *member, int type, void **
7878
return rv;
7979
}
8080

81-
static void saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot)
81+
static zval *saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot)
8282
{
8383
php_com_throw_exception(E_INVALIDARG, "safearray has no properties");
84+
return value;
8485
}
8586

8687
static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *rv)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Test curl_version() basic functionality
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded("curl")) {
6+
exit("skip curl extension not loaded");
7+
}
8+
?>
9+
--FILE--
10+
<?php
11+
$info_curl = curl_version();
12+
var_dump($info_curl["version_number"]);
13+
var_dump($info_curl["age"]);
14+
var_dump($info_curl["features"]);
15+
var_dump($info_curl["ssl_version_number"]);
16+
var_dump($info_curl["version"]);
17+
var_dump($info_curl["host"]);
18+
var_dump($info_curl["ssl_version"]);
19+
var_dump($info_curl["libz_version"]);
20+
var_dump(array_key_exists("protocols", $info_curl));
21+
?>
22+
--EXPECTF--
23+
int(%i)
24+
int(%i)
25+
int(%i)
26+
int(%i)
27+
string(%i) "%s"
28+
string(%i) "%s"
29+
string(%i) "%s"
30+
string(%i) "%s"
31+
bool(true)

ext/intl/dateformat/dateformat_create.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
7070
intl_error_reset(NULL);
7171
object = return_value;
7272
/* Parse parameters. */
73-
if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs",
73+
if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "s!ll|zzs",
7474
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
7575
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
7676
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "

ext/intl/tests/bug77895.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Bug #77895: IntlDateFormatter::create fails in strict mode if $locale = null
3+
--FILE--
4+
<?php
5+
6+
declare(strict_types=1);
7+
8+
var_dump(IntlDateFormatter::create(null, IntlDateFormatter::NONE, IntlDateFormatter::NONE));
9+
10+
?>
11+
--EXPECT--
12+
object(IntlDateFormatter)#1 (0) {
13+
}

ext/spl/spl_array.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,8 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam
14701470
} else {
14711471
GC_DELREF(aht);
14721472
}
1473-
efree(Z_REF(params[0]));
1473+
ZVAL_NULL(Z_REFVAL(params[0]));
1474+
zval_ptr_dtor(&params[0]);
14741475
zend_string_free(Z_STR(function_name));
14751476
}
14761477
} /* }}} */

main/network.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_lo
515515
struct sockaddr_in6 *in6 = (struct sockaddr_in6*)sa;
516516
#endif
517517

518+
memset(sa, 0, sizeof(struct sockaddr));
519+
518520
if (*addr == '[') {
519521
colon = memchr(addr + 1, ']', addrlen-1);
520522
if (!colon || colon[1] != ':') {

0 commit comments

Comments
 (0)