Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#37220 closed defect (bug)

Improvement symlinks on wp-config.php — at Initial Version

Reported by: grazianognoll Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.3
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

Hello,
i noticed working on a wordpress website that if the website is in a directory (es. /var/www/releases/3/) and the web root is pointing through a symbolic link ( so. /var/www/current/ pointing to /var/www/releases/3/ ) the function in the wordpress config is not retrieving the right directory:

if ( !defined('ABSPATH') )

define('ABSPATH', dirname(FILE) . '/');

I solved manually defining ABSPATH to the right directory, but i think it would be better to fix if maybe checking if the directory is a symlink.

The problem is that from php5 FILE is reporting the absolute path, so it may be better to use $_SERVERPWD? to retrieve the path:
<?php echo $_SERVERPWD? ."\n"; ?>
would be
/var/www/current

Thanks,
Emanuele.

Change History (0)

Note: See TracTickets for help on using tickets.