[wp-trac] [WordPress Trac] #18260: Don't prepend scheme to urls staring with a question mark in esc_url()

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 26 19:33:57 UTC 2011


#18260: Don't prepend scheme to urls staring with a question mark in esc_url()
--------------------------+--------------------
 Reporter:  ryan          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.3
Component:  Formatting    |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by nacin):

 Looks good. Code wise, another option: `! in_array( $url[0], array( '/',
 '#', '?' ) )`.

 Not sure if the in_array() will be faster, but array access should be
 faster than substr, especially if limited to one time.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18260#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list