Opened 5 years ago
Closed 5 years ago
#49940 closed enhancement (wontfix)
Replace dirname( __DIR__ ) with relative path
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | coding-standards | Cc: |
Description
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/user/admin.php#L12
require_once '../admin.php';
Maybe also in other parts of code
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Using
dirname( __DIR__ )
is intentional here, see [25616] / #17092 and comment:1:ticket:37060 for more context.Switching to a relative path would make the code rely on PHP
include_path
configuration, which in some scenarios can lead to including a wrong file and causing obscure issues.Using a full path guards against that.