mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-08 03:24:48 +01:00
Merge pull request #53 from danielyxie/dev
Fixed error with determining invalid IP address
This commit is contained in:
@ -32,9 +32,9 @@ createRandomByte = function() {
|
||||
}
|
||||
|
||||
isValidIPAddress = function(ipaddress) {
|
||||
if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress))
|
||||
if (/^(25[0-6]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-6]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-6]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-6]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false ;
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user