﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19825	URLValidator	agestart@…	nobody	"if url have space i get error ""raise ValidationError(_(u'Enter a valid URL.'), code='invalid')"" if I quote link I get ""broken_error"".

I created the patch:


{{{
*** core/validators.py	2012-11-21 12:55:55.675173918 +0400
--- core/validators.py	2012-11-21 15:31:57.895171400 +0400
***************
*** 50,56 ****
          r'localhost|' #localhost...
          r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
          r'(?::\d+)?' # optional port
!         r'(?:/?|[/?]\S+)$', re.IGNORECASE)
  
      def __init__(self, verify_exists=False,
                   validator_user_agent=URL_VALIDATOR_USER_AGENT):
--- 50,56 ----
          r'localhost|' #localhost...
          r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
          r'(?::\d+)?' # optional port
!         r'(?:/?|[/?].+)$', re.IGNORECASE)
  
      def __init__(self, verify_exists=False,
                   validator_user_agent=URL_VALIDATOR_USER_AGENT):
***************
*** 94,99 ****
--- 94,100 ----
              }
              url = url.encode('utf-8')
              # Quote characters from the unreserved set, refs #16812
+             url = '%' in url and urllib.unquote(url) or url
              url = urllib.quote(url, ""!*'();:@&=+$,/?#[]"")
              broken_error = ValidationError(
                  _(u'This URL appears to be a broken link.'), code='invalid_link')

}}}
"	Bug	closed	Forms	1.4	Normal	invalid	urlvalidator url field validator		Unreviewed	0	0	0	0	0	0
