Validate URL in homepage field

Created on 11 April 2012, over 12 years ago
Updated 1 February 2024, 7 months ago

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

Feature request
Status

Active

Version

11.0 🔥

Component
Comment 

Last updated 1 day ago

Created by

🇮🇪Ireland frankdesign

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024