﻿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
6717	newforms URL validation rejects leading/trailing space	Antti Kaihola	nobody	"URL fields raise a validation error if a valid URL has leading or trailing spaces. A string with only spaces also raises an error instead of being interpreted as empty when the field is not required.
{{{
>>> from django import newforms as forms
>>> u=forms.URLField(required=False)
>>> u.clean('www.djangoproject.com')
u'http://www.djangoproject.com'
>>> u.clean('  http://www.djangoproject.com/')
ValidationError: [u'Enter a valid URL.']
>>> u.clean('http://www.djangoproject.com/  ')
ValidationError: [u'Enter a valid URL.']
>>> u.clean('  ')
ValidationError: [u'Enter a valid URL.']
}}}

Django should first strip leading and trailing spaces from the URL before validating it.

Rationale:
 * browser address fields strip URLs
 * Python's urllib and urllib2 open URLs with leading/trailing spaces correctly
 * leading/trailing spaces and only-space strings are hard to spot for non-experienced web users
 * ""Be liberal in what you accept, and conservative in what you send"""		closed	Forms	dev		duplicate	url validation		Unreviewed	1	0	0	0	0	0
