[wp-trac] [WordPress Trac] #34407: esc_url() cannot handle a relative URL containing a : character (IPv6)

WordPress Trac noreply at wordpress.org
Tue Nov 8 16:00:16 UTC 2016


#34407: esc_url() cannot handle a relative URL containing a : character (IPv6)
--------------------------+------------------------------
 Reporter:  dd32          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by jadpm):

 Note thst this is also broken when trying to escape a URL that contains a
 port number:
 `error_log( esc_url( 'http://example.com:8080' ) );// Outputs
 http://example.com:8080`
 `error_log( esc_url( 'example.com' ) );// Outputs http://example.com`
 `error_log( esc_url( 'example.com:8080' ) );// Outputs an empty string`

 That means that URLs containing no protocol but a port number can not be
 sanitized. The only solution for now is to include the protocol.

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


More information about the wp-trac mailing list