Opened 6 years ago
Last modified 4 years ago
#41180 new defect (bug)
ABSPATH definition - incorrect on chrooted vhost
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.8 |
Component: | Bootstrap/Load | Keywords: | has-patch needs-testing |
Focuses: | performance | Cc: |
Description
ABSPATH defined in wp-load.php (and in other files) returns incorrect string on chrooted vhosts (double slash '/' instead of a single):
<?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 if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', ('/' === dirname( __FILE__ )) ? dirname( __FILE__ ) : dirname( __FILE__ ) . '/' ); }
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Hi @dacartpl, welcome to Core Trac! If you're willing, I'd encourage you to upload a patch yourself, either diffed against https://develop.svn.wordpress.org or http://develop.git.wordpress.org, your preference.
For more on contributing patches, see submitting a patch in our core handbook.