We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b79a79 commit 1d24382Copy full SHA for 1d24382
src/Countries.php
@@ -368,6 +368,10 @@ public function validateCountryCode(string $countryCode) : bool
368
*/
369
public function validateIpAddress(string $ipAddress) : bool
370
{
371
+ if (empty($ipAddress)) {
372
+ return false;
373
+ }
374
+
375
return (bool) filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE);
376
}
377
@@ -382,7 +386,7 @@ public function validateIpAddress(string $ipAddress) : bool
382
386
383
387
public function ip(string $ipAddress) : string
384
388
385
- if (empty($ipAddress) || !$this->validateIpAddress($ipAddress)) {
389
+ if (!$this->validateIpAddress($ipAddress)) {
390
return '';
391
392
0 commit comments