[wp-trac] [WordPress Trac] #17048: URLs delivered to the browser should be root-relative

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 11 05:15:37 UTC 2011


#17048: URLs delivered to the browser should be root-relative
--------------------------+-------------------------
 Reporter:  dmole         |       Owner:  edwardw
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  3.1
 Severity:  normal        |  Resolution:  maybelater
 Keywords:  dev-feedback  |
--------------------------+-------------------------

Comment (by dmole):

 Replying to [comment:7 nacin]:

 Thanks for the config hint, I found this code works:

 #wp-config.php:
 {{{
  /** Hack to make URLs root relative */
  ob_start( 'make_url_root_relative' );
  function make_url_root_relative( $string ) {
       return  preg_replace( '/https?...[^\/]+\//i', '/', $string );
  }
  }}}
 It's more run time work when a proper patch would actually be less, but
 those who care will be using compressed caching anyway.

 It would be best if this did not effect URLs used in emails. Maybe someone
 will comment on that.

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


More information about the wp-trac mailing list