Created
February 3, 2016 10:24
-
-
Save jolle-c/29bb9e8a0dff718de930 to your computer and use it in GitHub Desktop.
Lasso 9 method to check if a range of IP numbers match the current client ip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**! | |
client_ip_isin | |
Will return true if client_ip matches any of the strings in the provided staticarray | |
Examples | |
client_ip_isin((: '127.*', '94.219.224.*')) | |
2014-09-10 JC First version | |
*/ | |
define client_ip_isin(check::staticarray) => { | |
with item in #check do { | |
client_ip == #item ? return true | |
} | |
return false | |
} | |
define client_ip_isin(check::array) => { | |
with item in #check do { | |
client_ip == #item ? return true | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment