You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/03/27 17:12:29 UTC
[2/5] git commit: [#7160] ticket:546 Downgrade back FormEncode
version, just use new regex for url
[#7160] ticket:546 Downgrade back FormEncode version, just use new regex for url
New FormEncode breaks something in parameters encoding and validation (~30 test failures),
it's easier now to copy regex from newer version for URL validator. Especially since we're already overriding that for ValidateSvnUrl.
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/3f5a2062
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3f5a2062
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3f5a2062
Branch: refs/heads/master
Commit: 3f5a20629beb53aafc9e0de9dbaf45a57d7025b7
Parents: fd618a7
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Feb 27 12:58:28 2014 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Mar 27 16:12:14 2014 +0000
----------------------------------------------------------------------
Allura/allura/lib/validators.py | 14 ++++++++++++++
requirements-common.txt | 2 +-
2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/3f5a2062/Allura/allura/lib/validators.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/validators.py b/Allura/allura/lib/validators.py
index 964160d..bfb87a8 100644
--- a/Allura/allura/lib/validators.py
+++ b/Allura/allura/lib/validators.py
@@ -29,6 +29,20 @@ class URL(fev.URL):
# allows use of IP address instead of domain name
require_tld = False
+ url_re = re.compile(r'''
+ ^(http|https)://
+ (?:[%:\w]*@)? # authenticator
+ (?: # ip or domain
+ (?P<ip>(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|
+ (?P<domain>[a-z0-9][a-z0-9\-]{,62}\.)* # subdomain
+ (?P<tld>[a-z]{2,63}|xn--[a-z0-9\-]{2,59}) # top level domain
+ )
+ (?::[0-9]{1,5})? # port
+ # files/delims/etc
+ (?P<path>/[a-z0-9\-\._~:/\?#\[\]@!%\$&\'\(\)\*\+,;=]*)?
+ $
+ ''', re.I | re.VERBOSE)
+
class Ming(fev.FancyValidator):
http://git-wip-us.apache.org/repos/asf/allura/blob/3f5a2062/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index a0efd00..7d8e70e 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -13,7 +13,7 @@ docutils==0.9
EasyWidgets==0.2dev-20130716
faulthandler==2.1
feedparser==5.0.1
-FormEncode==1.2.6
+FormEncode==1.2.4
# dep of Creoleparser
Genshi==0.6
# dep of oauth2