Skip to content

Commit 7ceb474

Browse files
committed
3rd arg to stream_set_timeout is optional
ignore_user_abort() should take a bool not a string
1 parent 20585be commit 7ceb474

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/standard/basic_functions.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0)
20892089
ZEND_END_ARG_INFO()
20902090

20912091
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
2092-
ZEND_BEGIN_ARG_INFO(arginfo_stream_set_timeout, 0)
2092+
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_set_timeout, 0, 0, 2)
20932093
ZEND_ARG_INFO(0, stream)
20942094
ZEND_ARG_INFO(0, seconds)
20952095
ZEND_ARG_INFO(0, microseconds)
@@ -5509,22 +5509,22 @@ PHP_FUNCTION(connection_status)
55095509
}
55105510
/* }}} */
55115511

5512-
/* {{{ proto int ignore_user_abort([string value])
5512+
/* {{{ proto int ignore_user_abort([bool value])
55135513
Set whether we want to ignore a user abort event or not */
55145514
PHP_FUNCTION(ignore_user_abort)
55155515
{
5516-
zend_string *arg = NULL;
5516+
zend_bool arg = 0;
55175517
int old_setting;
55185518

5519-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &arg) == FAILURE) {
5519+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &arg) == FAILURE) {
55205520
return;
55215521
}
55225522

55235523
old_setting = PG(ignore_user_abort);
55245524

55255525
if (arg) {
55265526
zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort"), 0);
5527-
zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
5527+
zend_alter_ini_entry_chars(key, arg ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
55285528
zend_string_release(key);
55295529
}
55305530

0 commit comments

Comments
 (0)