From f970ac2579bbb9d3de16b2274ee04c7de1164fed Mon Sep 17 00:00:00 2001 From: valmorflores Date: Mon, 30 May 2022 08:46:59 -0300 Subject: [PATCH] Small change to improve code reading Small change to improve the reading and understanding of the code, for not type conflict. --- system/Validation/FormatRules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/Validation/FormatRules.php b/system/Validation/FormatRules.php index 21353d1a3385..3aa1c6840ceb 100644 --- a/system/Validation/FormatRules.php +++ b/system/Validation/FormatRules.php @@ -266,19 +266,19 @@ public function valid_ip(?string $ip = null, ?string $which = null): bool switch (strtolower($which ?? '')) { case 'ipv4': - $which = FILTER_FLAG_IPV4; + $option = FILTER_FLAG_IPV4; break; case 'ipv6': - $which = FILTER_FLAG_IPV6; + $option = FILTER_FLAG_IPV6; break; default: - $which = 0; + $option = 0; } - return filter_var($ip, FILTER_VALIDATE_IP, $which) !== false - || (! ctype_print($ip) && filter_var(inet_ntop($ip), FILTER_VALIDATE_IP, $which) !== false); + return filter_var($ip, FILTER_VALIDATE_IP, $option) !== false + || (! ctype_print($ip) && filter_var(inet_ntop($ip), FILTER_VALIDATE_IP, $option) !== false); } /**