[wp-trac] [WordPress Trac] #22330: Optimize regexes to remove protocol from URL

WordPress Trac noreply at wordpress.org
Wed Oct 31 09:30:49 UTC 2012


#22330: Optimize regexes to remove protocol from URL
-----------------------------+-------------------------
 Reporter:  GeertDD          |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  3.4.2            |   Severity:  minor
 Keywords:  has-patch        |
-----------------------------+-------------------------
 Regexes used to chop off the protocol of a URL should be anchored to the
 start of the string.

 1. The regex fails faster and thus avoid useless work. No need to look
 further down the URL for strings like `"http://"`.
 2. The regex should not alter any URLs that might be contained in the
 query string.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22330>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list