From 8a2d18b63b6695e6fbadfea0398319b062cc224d Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 12 Oct 2012 18:17:06 -0500 Subject: [PATCH] ip address validator fixed --- VERSION | 2 +- gluon/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8f61b039..eb595278 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.1.0 (2012-10-12 12:18:47) dev +Version 2.1.0 (2012-10-12 18:16:59) dev diff --git a/gluon/utils.py b/gluon/utils.py index 1d1e232c..e10fb7a4 100644 --- a/gluon/utils.py +++ b/gluon/utils.py @@ -191,6 +191,8 @@ def is_valid_ip_address(address): elif address.lower() in ('unkown',''): return False elif address.count('.')==3: # assume IPv4 + if address.startswith('::ffff:'): + address = address[7:] if hasattr(socket,'inet_aton'): # try validate using the OS try: addr = socket.inet_aton(address)