[wp-trac] [WordPress Trac] #41180: ABSPATH definition - incorrect on chrooted vhost

WordPress Trac noreply at wordpress.org
Tue Jun 27 08:17:41 UTC 2017


#41180: ABSPATH definition - incorrect on chrooted vhost
----------------------------+-----------------------------
 Reporter:  dacartpl        |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Bootstrap/Load  |    Version:  4.8
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 ABSPATH defined in wp-load.php (and in other files) returns incorrect
 string on chrooted vhosts (double slash '/' instead of a single):

 {{{#!php
 <?php
 if ( ! defined( 'ABSPATH' ) ) {
         define( 'ABSPATH', dirname( __FILE__ ) . '/' );
 }
 }}}


 On chrooted vhost - output of dirname( __FILE__ ) is '/' and no need to
 add additional '/' at the end of string.

 It would be nice if the ABSPATH definition looked like the following:

 {{{#!php
 <?php

 if ( ! defined( 'ABSPATH' ) ) {
         define( 'ABSPATH', ('/' === dirname( __FILE__ )) ? dirname(
 __FILE__ ) : dirname( __FILE__ ) . '/' );
 }

 }}}

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


More information about the wp-trac mailing list