Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 302535

Validate URL in homepage field

$
0
0

The validate function for the homepage field of a Comment form currently requires that the URL includes http:// - which is an outdated and non user friendly way of expecting someone to input their website address. I have figured out how to alter the Comment Module to allow someone to enter either www.example.com, http://example.com or even https://www.example.com (I found the details on http://drupal.stackexchange.com/questions/1037/allow-comment-homepage-ur...). But I haven't figured out yet how to get my own module to work to make the change (see http://drupal.org/node/449818#comment-5828200).

In the meantime, I thought I would suggest that it be included in Drupal Core in future editions. The code that is required directly before the validation of the homepage field is

if (strpos($edit['homepage'], "://") === FALSE) {
    $edit['homepage'] = "http://" . $edit['homepage'];
}

F


Viewing all articles
Browse latest Browse all 302535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>