diff --git a/module/CLI/test/RedirectRule/RedirectRuleHandlerTest.php b/module/CLI/test/RedirectRule/RedirectRuleHandlerTest.php index 0c0b7d12..edd1eae3 100644 --- a/module/CLI/test/RedirectRule/RedirectRuleHandlerTest.php +++ b/module/CLI/test/RedirectRule/RedirectRuleHandlerTest.php @@ -116,6 +116,7 @@ class RedirectRuleHandlerTest extends TestCase 'Language to match?' => 'en-US', 'Query param name?' => 'foo', 'Query param value?' => 'bar', + 'IP address, CIDR block or wildcard-pattern (1.2.*.*)' => '1.2.3.4', default => '', }, ); @@ -163,6 +164,7 @@ class RedirectRuleHandlerTest extends TestCase [RedirectCondition::forQueryParam('foo', 'bar'), RedirectCondition::forQueryParam('foo', 'bar')], true, ]; + yield 'IP address' => [RedirectConditionType::IP_ADDRESS, [RedirectCondition::forIpAddress('1.2.3.4')]]; } #[Test] diff --git a/module/Core/src/Util/IpAddressUtils.php b/module/Core/src/Util/IpAddressUtils.php index 79e7f839..f5e1b052 100644 --- a/module/Core/src/Util/IpAddressUtils.php +++ b/module/Core/src/Util/IpAddressUtils.php @@ -26,7 +26,7 @@ final class IpAddressUtils * Matching will happen as follows: * * Static IP address -> strict equality with provided IP address. * * CIDR block -> provided IP address is part of that block. - * * Wildcard -> static parts match the corresponding ones in provided IP address. + * * Wildcard pattern -> static parts match the corresponding ones in provided IP address. * * @param string[] $groups * @throws InvalidIpFormatException