Skip to content

Commit 5920c26

Browse files
authored
Update FormatRules.php
+ allows storing IP as varbinary more easily ;-)
1 parent 248ed2f commit 5920c26

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/Validation/FormatRules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public function valid_ip(string $ip = null, string $which = null): bool
364364
break;
365365
}
366366

367-
return (bool) filter_var($ip, FILTER_VALIDATE_IP, $which);
367+
return (bool) filter_var($ip, FILTER_VALIDATE_IP, $which) || (bool) filter_var(inet_ntop($ip), FILTER_VALIDATE_IP, $which);
368368
}
369369

370370
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)