Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ PHP NEWS
null destination). (David Carlier)
. Fixed bug GH-13204 (glob() fails if square bracket is in current directory).
(ndossche)
. Add array size maximum to array_diff(). (ndossche)

- Streams:
. Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream
Expand Down
7 changes: 0 additions & 7 deletions ext/ftp/php_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,27 +1264,23 @@ PHP_FUNCTION(ftp_set_option)
}
ftp->timeout_sec = Z_LVAL_P(z_value);
RETURN_TRUE;
break;
case PHP_FTP_OPT_AUTOSEEK:
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
zend_argument_type_error(3, "must be of type bool for the FTP_AUTOSEEK option, %s given", zend_zval_value_name(z_value));
RETURN_THROWS();
}
ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0;
RETURN_TRUE;
break;
case PHP_FTP_OPT_USEPASVADDRESS:
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
zend_argument_type_error(3, "must be of type bool for the FTP_USEPASVADDRESS option, %s given", zend_zval_value_name(z_value));
RETURN_THROWS();
}
ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0;
RETURN_TRUE;
break;
default:
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
RETURN_THROWS();
break;
}
}
/* }}} */
Expand All @@ -1304,13 +1300,10 @@ PHP_FUNCTION(ftp_get_option)
switch (option) {
case PHP_FTP_OPT_TIMEOUT_SEC:
RETURN_LONG(ftp->timeout_sec);
break;
case PHP_FTP_OPT_AUTOSEEK:
RETURN_BOOL(ftp->autoseek);
break;
case PHP_FTP_OPT_USEPASVADDRESS:
RETURN_BOOL(ftp->usepasvaddress);
break;
default:
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
RETURN_THROWS();
Expand Down
1 change: 0 additions & 1 deletion ext/lexbor/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PHP_LEXBOR_CFLAGS="-I@ext_srcdir@/"
LEXBOR_DIR="lexbor"

AC_DEFINE([HAVE_LEXBOR], [1], [Define to 1 if the PHP extension 'lexbor' is available.])
AC_DEFINE([LEXBOR_VERSION], ["2.5.0"], [Define the main Lexbor version])

PHP_NEW_EXTENSION([lexbor], m4_normalize([
php_lexbor.c
Expand Down
1 change: 0 additions & 1 deletion ext/lexbor/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ ADD_SOURCES("ext/lexbor/lexbor/url", "url.c","lexbor");
ADD_FLAG("CFLAGS_LEXBOR", "/D LEXBOR_BUILDING /utf-8");

AC_DEFINE("HAVE_LEXBOR", 1, "Define to 1 if the PHP extension 'lexbor' is available.");
AC_DEFINE("LEXBOR_VERSION", "2.5.0", "Define the main Lexbor version")

PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h lexbor/");
3 changes: 2 additions & 1 deletion ext/lexbor/php_lexbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "php.h"
#include "zend_globals.h"
#include "ext/standard/info.h"
#include "lexbor/core/base.h"
#include "lexbor/core/types.h"
#include "lexbor/core/lexbor.h"

Expand Down Expand Up @@ -53,7 +54,7 @@ static PHP_MINFO_FUNCTION(lexbor)
{
php_info_print_table_start();
php_info_print_table_row(2, "Lexbor support", "active");
php_info_print_table_row(2, "Lexbor version", LEXBOR_VERSION);
php_info_print_table_row(2, "Lexbor version", LEXBOR_VERSION_STRING);
php_info_print_table_end();
}

Expand Down
20 changes: 16 additions & 4 deletions ext/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2712,16 +2712,21 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
/* tack on extra headers */
if (zheaders) {
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
int ret;
zend_string *str = zval_try_get_string(zcertval);
if (UNEXPECTED(!str)) {
goto clean_exit;
}
if (strindex) {
BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
ret = BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
} else {
BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
ret = BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
}
zend_string_release(str);
if (ret < 0) {
php_openssl_store_errors();
goto clean_exit;
}
} ZEND_HASH_FOREACH_END();
}

Expand Down Expand Up @@ -2941,6 +2946,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
zend_string_release(str);
if (ret < 0) {
php_openssl_store_errors();
goto clean_exit;
}
} ZEND_HASH_FOREACH_END();
}
Expand Down Expand Up @@ -3341,16 +3347,21 @@ PHP_FUNCTION(openssl_cms_encrypt)
/* tack on extra headers */
if (zheaders && encoding == ENCODING_SMIME) {
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zheaders), strindex, zcertval) {
int ret;
zend_string *str = zval_try_get_string(zcertval);
if (UNEXPECTED(!str)) {
goto clean_exit;
}
if (strindex) {
BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
ret = BIO_printf(outfile, "%s: %s\n", ZSTR_VAL(strindex), ZSTR_VAL(str));
} else {
BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
ret = BIO_printf(outfile, "%s\n", ZSTR_VAL(str));
}
zend_string_release(str);
if (ret < 0) {
php_openssl_store_errors();
goto clean_exit;
}
} ZEND_HASH_FOREACH_END();
}

Expand Down Expand Up @@ -3631,6 +3642,7 @@ PHP_FUNCTION(openssl_cms_sign)
zend_string_release(str);
if (ret < 0) {
php_openssl_store_errors();
goto clean_exit;
}
} ZEND_HASH_FOREACH_END();
}
Expand Down
8 changes: 2 additions & 6 deletions ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -1814,18 +1814,14 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
switch (entry_type) {
case PHP_PG_FIELD_NAME:
RETURN_STRING(PQfname(pgsql_result, (int)field));
break;
case PHP_PG_FIELD_SIZE:
RETURN_LONG(PQfsize(pgsql_result, (int)field));
break;
case PHP_PG_FIELD_TYPE:
RETURN_STR(get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field)));
break;
case PHP_PG_FIELD_TYPE_OID:

oid = PQftype(pgsql_result, (int)field);
PGSQL_RETURN_OID(oid);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
Expand Down Expand Up @@ -4545,8 +4541,8 @@ PHP_FUNCTION(pg_flush)
}

switch (ret) {
case 0: RETURN_TRUE; break;
case 1: RETURN_LONG(0); break;
case 0: RETURN_TRUE;
case 1: RETURN_LONG(0);
default: RETURN_FALSE;
}
}
Expand Down
7 changes: 6 additions & 1 deletion ext/standard/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -5741,7 +5741,7 @@ PHP_FUNCTION(array_diff)
{
zval *args;
uint32_t argc, i;
uint32_t num;
uint64_t num;
HashTable exclude;
zval *value;
zend_string *str, *tmp_str, *key;
Expand Down Expand Up @@ -5831,6 +5831,11 @@ PHP_FUNCTION(array_diff)
return;
}

if (UNEXPECTED(num >= HT_MAX_SIZE)) {
zend_throw_error(NULL, "The total number of elements must be lower than %u", HT_MAX_SIZE);
RETURN_THROWS();
}

ZVAL_NULL(&dummy);
/* create exclude map */
zend_hash_init(&exclude, num, NULL, NULL, 0);
Expand Down