Last active
August 29, 2015 14:07
-
-
Save jolle-c/7cfb53fa49da66d82df9 to your computer and use it in GitHub Desktop.
Method to check if client_ip matches any of the strings in a provided staticarray
This file contains 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.*', '90.229.223.*')) | |
2014-10-08 JC Added to Gist | |
2014-09-10 JC First version | |
*/ | |
define client_ip_isin(check::staticarray) => { | |
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