[wp-trac] [WordPress Trac] #52886: Update esc_url to allow for specifying an https:// as default protocol

WordPress Trac noreply at wordpress.org
Wed Sep 8 21:30:38 UTC 2021


#52886: Update esc_url to allow for specifying an https:// as default protocol
-------------------------------------------------+-------------------------
 Reporter:  mkaz                                 |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  dev-note                                       |
-------------------------------------------------+-------------------------

Comment (by mkaz):

 In this case, would wp_is_using_https()Docs be appropriate regarding
 "known to use https://" as it tests the home and site URLs?

 No, unfortunately that wouldn't solve the case I'm looking for, that
 function only works for the current site while the `esc_url()` function
 can be passed any arbitrary URL which it won't know if it is SSL or not.

 The example is a Twitter profile link passed in like: `twitter.com/mkaz`
 ideally it would by default return `https` but `esc_url()` will return
 `http`.

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


More information about the wp-trac mailing list