Skip to content

Commit db91143

Browse files
committed
Another round
1 parent fddfc88 commit db91143

File tree

6 files changed

+31
-23
lines changed

6 files changed

+31
-23
lines changed

ext/soap/soap.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,14 @@ PHP_METHOD(SoapHeader, __construct)
575575
}
576576
add_property_bool(this_ptr, "mustUnderstand", must_understand);
577577

578-
if (!actor_is_null) {
579-
if (actor_str && ZSTR_LEN(actor_str) > 2) {
578+
if (actor_str) {
579+
if (ZSTR_LEN(actor_str) > 2) {
580580
add_property_stringl(this_ptr, "actor", ZSTR_VAL(actor_str), ZSTR_LEN(actor_str));
581-
} else if ((actor_long == SOAP_ACTOR_NEXT || actor_long == SOAP_ACTOR_NONE || actor_long == SOAP_ACTOR_UNLIMATERECEIVER)) {
581+
} else {
582+
php_error_docref(NULL, E_WARNING, "Invalid actor");
583+
}
584+
} else if (actor_is_null) {
585+
if ((actor_long == SOAP_ACTOR_NEXT || actor_long == SOAP_ACTOR_NONE || actor_long == SOAP_ACTOR_UNLIMATERECEIVER)) {
582586
add_property_long(this_ptr, "actor", actor_long);
583587
} else {
584588
php_error_docref(NULL, E_WARNING, "Invalid actor");
@@ -609,15 +613,13 @@ PHP_METHOD(SoapFault, __construct)
609613
if (code_str) {
610614
fault_code = ZSTR_VAL(code_str);
611615
fault_code_len = ZSTR_LEN(code_str);
612-
} else if (code_ht) {
613-
if (zend_hash_num_elements(code_ht) == 2) {
614-
zval *t_ns = zend_hash_index_find(code_ht, 0);
615-
zval *t_code = zend_hash_index_find(code_ht, 1);
616-
if (t_ns && t_code && Z_TYPE_P(t_ns) == IS_STRING && Z_TYPE_P(t_code) == IS_STRING) {
617-
fault_code_ns = Z_STRVAL_P(t_ns);
618-
fault_code = Z_STRVAL_P(t_code);
619-
fault_code_len = Z_STRLEN_P(t_code);
620-
}
616+
} else if (code_ht && zend_hash_num_elements(code_ht) == 2) {
617+
zval *t_ns = zend_hash_index_find(code_ht, 0);
618+
zval *t_code = zend_hash_index_find(code_ht, 1);
619+
if (t_ns && t_code && Z_TYPE_P(t_ns) == IS_STRING && Z_TYPE_P(t_code) == IS_STRING) {
620+
fault_code_ns = Z_STRVAL_P(t_ns);
621+
fault_code = Z_STRVAL_P(t_code);
622+
fault_code_len = Z_STRLEN_P(t_code);
621623
}
622624
}
623625

ext/standard/tests/filters/php_user_filter_01.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ class bar extends php_user_filter {
1414
}
1515
?>
1616
--EXPECTF--
17-
Fatal error: Declaration of bar::filter($in, $out, &$consumed) must be compatible with php_user_filter::filter(mixed $in, mixed $out, mixed &$consumed, mixed $closing) in %s on line %d
17+
Fatal error: Declaration of bar::filter($in, $out, &$consumed) must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d

ext/standard/tests/filters/php_user_filter_02.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ class foo extends php_user_filter {
99
}
1010
?>
1111
--EXPECTF--
12-
Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing) must be compatible with php_user_filter::filter(mixed $in, mixed $out, mixed &$consumed, mixed $closing) in %s on line %d
12+
Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing) must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d

ext/standard/user_filters.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ static int le_bucket;
4141

4242
PHP_METHOD(php_user_filter, filter)
4343
{
44-
zval *in, *out, *consumed, *closing;
45-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzzz", &in, &out, &consumed, &closing) == FAILURE) {
44+
zval *in, *out, *consumed;
45+
zend_bool closing;
46+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrzb", &in, &out, &consumed, &closing) == FAILURE) {
4647
RETURN_THROWS();
4748
}
4849
}

ext/standard/user_filters.stub.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44

55
class php_user_filter
66
{
7-
/** @return int */
8-
public function filter(mixed $in, mixed $out, mixed &$consumed, mixed $closing) {}
7+
/**
8+
* @param resource $in
9+
* @param resource $out
10+
* @param int $consumed
11+
* @return int
12+
*/
13+
public function filter($in, $out, &$consumed, bool $closing) {}
914

1015
/** @return void */
1116
public function onCreate() {}

ext/standard/user_filters_arginfo.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 1917249014ff29c226c94ac0e46e7a9f00261d0d */
2+
* Stub hash: b3876ce9055a9417d0d1db9f97235513740de956 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_php_user_filter_filter, 0, 0, 4)
5-
ZEND_ARG_TYPE_INFO(0, in, IS_MIXED, 0)
6-
ZEND_ARG_TYPE_INFO(0, out, IS_MIXED, 0)
7-
ZEND_ARG_TYPE_INFO(1, consumed, IS_MIXED, 0)
8-
ZEND_ARG_TYPE_INFO(0, closing, IS_MIXED, 0)
5+
ZEND_ARG_INFO(0, in)
6+
ZEND_ARG_INFO(0, out)
7+
ZEND_ARG_INFO(1, consumed)
8+
ZEND_ARG_TYPE_INFO(0, closing, _IS_BOOL, 0)
99
ZEND_END_ARG_INFO()
1010

1111
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_php_user_filter_onCreate, 0, 0, 0)

0 commit comments

Comments
 (0)