diff --git a/NEWS b/NEWS index a6c44c47bc44..2e7adae0d951 100644 --- a/NEWS +++ b/NEWS @@ -80,6 +80,13 @@ PHP NEWS . SessionHandler::validateId() is now implemented, so session.use_strict_mode applies to the built-in handler. (Girgias) +- Sodium: + . Fixed incorrect parameter name in sodium_add(), sodium_memcmp(), and + sodium_compare() length-mismatch error messages. (lacatoire) + +- Standard: + . Fixed incorrect parameter name in convert_uudecode() warning. (lacatoire) + - Zip: . Fixed bug GH-17787 (ZipArchive stream stops reading early when the archive is freed while the stream is still open). (Eyüp Can Akman) diff --git a/ext/session/session.c b/ext/session/session.c index 6a9f2b355c12..21545ecc01ba 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1482,10 +1482,10 @@ static zend_result php_session_send_cookie(void) php_session_remove_cookie(); /* remove already sent session ID cookie */ /* 'replace' must be 0 here, else a previous Set-Cookie header, probably sent with setcookie() will be replaced! */ - sapi_add_header_ex(estrndup(ZSTR_VAL(ncookie.s), ZSTR_LEN(ncookie.s)), ZSTR_LEN(ncookie.s), false, false); + zend_result result = sapi_add_header_ex(estrndup(ZSTR_VAL(ncookie.s), ZSTR_LEN(ncookie.s)), ZSTR_LEN(ncookie.s), false, false); smart_str_free(&ncookie); - return SUCCESS; + return result; } PHPAPI const ps_module *_php_find_ps_module(const char *name) diff --git a/ext/session/tests/session_start_cookie_header_rejected.phpt b/ext/session/tests/session_start_cookie_header_rejected.phpt new file mode 100644 index 000000000000..6c3e3b78a3b5 --- /dev/null +++ b/ext/session/tests/session_start_cookie_header_rejected.phpt @@ -0,0 +1,28 @@ +--TEST-- +session_start() when the SAPI rejects the session cookie header +--INI-- +session.save_handler=files +session.name=PHPSESSID +session.gc_probability=0 +--EXTENSIONS-- +session +--FILE-- + "/\r\nX-Injected: yes"]); + +var_dump(session_start()); +var_dump(session_status() === PHP_SESSION_NONE); + +?> +--EXPECT-- +handler: Header may not contain more than a single header, new line detected +bool(false) +bool(true) diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4 index 22cab40adf3b..62ac5471da7a 100644 --- a/ext/snmp/config.m4 +++ b/ext/snmp/config.m4 @@ -51,6 +51,13 @@ if test "$PHP_SNMP" != "no"; then [AC_MSG_FAILURE([SNMP sanity check failed.])], [$SNMP_SHARED_LIBADD]) + dnl Check whether netsnmp_init_mib() exists. + PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [netsnmp_init_mib], + [AC_DEFINE([HAVE_NETSNMP_INIT_MIB], [1], + [Define to 1 if the Net-SNMP library has the 'netsnmp_init_mib' function.])], + [], + [$SNMP_SHARED_LIBADD]) + dnl Check whether shutdown_snmp_logging() exists. PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [shutdown_snmp_logging], [AC_DEFINE([HAVE_SHUTDOWN_SNMP_LOGGING], [1], diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index bcca8d44de89..8fac85a236ab 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -1687,7 +1687,11 @@ PHP_FUNCTION(snmp_init_mib) shutdown_mib(); netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS, ZSTR_VAL(mibdirs)); +#ifdef HAVE_NETSNMP_INIT_MIB + netsnmp_init_mib(); +#else init_mib(); +#endif } /* }}} */ @@ -2228,7 +2232,11 @@ static PHP_RSHUTDOWN_FUNCTION(snmp) if (mib_needs_reset) { shutdown_mib(); netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS, NULL); +#ifdef HAVE_NETSNMP_INIT_MIB + netsnmp_init_mib(); +#else init_mib(); +#endif } return SUCCESS;