[wp-trac] [WordPress Trac] #52235: wp_extract_urls doesn't match localhost

WordPress Trac noreply at wordpress.org
Wed Jan 6 11:22:43 UTC 2021


#52235: wp_extract_urls doesn't match localhost
--------------------------+-----------------------------
 Reporter:  seanleavey    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The wp_extract_urls function does not match URLs with localhost as the
 domain:

 {{{#!php
 <?php
 // Matches.
 wp_extract_urls("<a href=\"http://localhost.com:8889/?p=9\">hi</a>");

 // Doesn't match.
 wp_extract_urls("<a href=\"http://localhost:8889/?p=9\">hi</a>");
 }}}

 I think this function should definitely match localhost because this is
 often used in testing environments. But if this is intended behaviour,
 then the documentation makes no mention that this function only matches a
 subset of allowed URLs.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52235>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list