Skip to content

Commit 279983d

Browse files
authored
ext/sockets: Use zval_is_true() instead of converting to boolean (#18681)
1 parent b05d50e commit 279983d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/sockets/multicast.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock,
293293
goto dosockopt;
294294

295295
case IP_MULTICAST_LOOP:
296-
convert_to_boolean(arg4);
297-
ipv4_mcast_ttl_lback = (unsigned char) (Z_TYPE_P(arg4) == IS_TRUE);
296+
ipv4_mcast_ttl_lback = (unsigned char) zval_is_true(arg4);
298297
goto ipv4_loop_ttl;
299298

300299
case IP_MULTICAST_TTL:
@@ -358,8 +357,7 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
358357
goto dosockopt;
359358

360359
case IPV6_MULTICAST_LOOP:
361-
convert_to_boolean(arg4);
362-
ov = (int) Z_TYPE_P(arg4) == IS_TRUE;
360+
ov = (int) zval_is_true(arg4);
363361
goto ipv6_loop_hops;
364362
case IPV6_MULTICAST_HOPS:
365363
convert_to_long(arg4);

0 commit comments

Comments
 (0)