URLS that are preceded by a space throw a "not a valid URL" error. This can be really hard to track down if multiple link fields are in a form, since the field in question is not highlighted when the error is reported.

URLS are often long strings, and subject to cut-and-pasting. It's reasonable to expect trailing and preceding whitespace in such instances. Trailing spaces don't seem to cause a problem. Preceding spaces do.

Let's trim the front and end of the link URL?

Comments

caelon’s picture

Status: Active » Closed (cannot reproduce)

Using the latest 7.x-dev release of Drupal and Link 7.x-1.0, I was not able to reproduce this. I created a Link field in the Article content type. I then created an Article and put spaces at the beginning of the URL field. It accepted the link as valid and stripped the spaces.