You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #43550 [HttpFoundation] Remove possibility to pass null as $requestIp in IpUtils (W0rma)
This PR was merged into the 6.0 branch.
Discussion
----------
[HttpFoundation] Remove possibility to pass null as $requestIp in IpUtils
| Q | A
| ------------- | ---
| Branch? | 6.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #43350 (comment)
| License | MIT
| Doc PR |
Removes the code which was deprecated in #43411
Commits
-------
e95e97d Remove possibility to pass null as $requestIp in IpUtils
trigger_deprecation('symfony/http-foundation', '5.4', 'Passing null as $requestIp to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
39
-
40
-
returnfalse;
41
-
}
42
-
43
37
if (!\is_array($ips)) {
44
38
$ips = [$ips];
45
39
}
@@ -63,14 +57,8 @@ public static function checkIp(?string $requestIp, string|array $ips): bool
63
57
*
64
58
* @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet
trigger_deprecation('symfony/http-foundation', '5.4', 'Passing null as $requestIp to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
70
-
71
-
returnfalse;
72
-
}
73
-
74
62
$cacheKey = $requestIp.'-'.$ip;
75
63
if (isset(self::$checkedIps[$cacheKey])) {
76
64
returnself::$checkedIps[$cacheKey];
@@ -114,14 +102,8 @@ public static function checkIp4(?string $requestIp, string $ip): bool
114
102
*
115
103
* @throws \RuntimeException When IPV6 support is not enabled
trigger_deprecation('symfony/http-foundation', '5.4', 'Passing null as $requestIp to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php
-27
Original file line number
Diff line number
Diff line change
@@ -77,33 +77,6 @@ public function getIpv6Data()
77
77
];
78
78
}
79
79
80
-
/**
81
-
* @group legacy
82
-
*/
83
-
publicfunctiontestIpTriggersDeprecationOnNull()
84
-
{
85
-
$this->expectDeprecation('Since symfony/http-foundation 5.4: Passing null as $requestIp to "Symfony\Component\HttpFoundation\IpUtils::checkIp()" is deprecated, pass an empty string instead.');
$this->expectDeprecation('Since symfony/http-foundation 5.4: Passing null as $requestIp to "Symfony\Component\HttpFoundation\IpUtils::checkIp4()" is deprecated, pass an empty string instead.');
$this->expectDeprecation('Since symfony/http-foundation 5.4: Passing null as $requestIp to "Symfony\Component\HttpFoundation\IpUtils::checkIp6()" is deprecated, pass an empty string instead.');
0 commit comments