Skip to content

getaddrinfo flags deprecated warning #4615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
7 changes: 6 additions & 1 deletion ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,12 @@ PHP_FUNCTION(socket_addrinfo_lookup)
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zhints), key, hint) {
if (key) {
if (zend_string_equals_literal(key, "ai_flags")) {
hints.ai_flags = zval_get_long(hint);
#if HAVE_AI_IDN
if (zval_get_long(hint) & (AI_IDN_ALLOW_UNASSIGNED | AI_IDN_USE_STD3_ASCII_RULES)) {
php_error_docref(NULL, E_DEPRECATED, "AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES is deprecated");
}
#endif
hints.ai_flags = zval_get_long(hint);
} else if (zend_string_equals_literal(key, "ai_socktype")) {
hints.ai_socktype = zval_get_long(hint);
} else if (zend_string_equals_literal(key, "ai_protocol")) {
Expand Down