Improve regular expressions for queries. #390

Merged
merged 1 commit into from Feb 10, 2013

Projects

None yet

2 participants

@boone
Contributor
boone commented Feb 7, 2013

Many of the query regular expressions use ^ and $, which permit newlines in Ruby. We can use \A and \z instead. In addition, any address that began with "127" would return true on loopback_ip_address? These issues have been corrected in query.rb with tests.

Note: there are also several other instances of ^ and $ in regexes in the code. As these are mostly related to various provider implementations, I haven't reviewed if using \A and \z would be more appropriate for them.

Thanks!

@boone boone Use \A and \z in regular expressions to avoid newline issues. Also, d…
…o not consider any address that begins with 127 to be a loopback IP.
3819570
@alexreisner
Owner

Thanks for this!

@alexreisner alexreisner merged commit 97dffb7 into alexreisner:master Feb 10, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment