[wp-trac] [WordPress Trac] #25385: Validate URL for user comments in Comment Form

WordPress Trac noreply at wordpress.org
Mon May 23 20:23:35 UTC 2016


#25385: Validate URL for user comments in Comment Form
------------------------------------+-------------------------
 Reporter:  nofearinc               |       Owner:
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:
Component:  Comments                |     Version:
 Severity:  normal                  |  Resolution:  maybelater
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+-------------------------
Changes (by rachelbaker):

 * status:  new => closed
 * resolution:   => maybelater
 * milestone:  Awaiting Review =>


Comment:

 There is no one size fits all solution here.

 If the current theme supports `html5` for `comment-form` the `type=url`
 attribute is added to the comment_author_url input. You can use the
 `comment_form_default_fields` filter to add a `pattern` attribute with a
 regex that further restricts what urls should be allowed.  Example:
 `pattern="https?://.+"`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25385#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list