WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#25068 closed defect (bug) (duplicate)

Require relative to working directory, not file

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: General Keywords:
Focuses: Cc:

Description

Some requires are done relative to the current working directory of the script albeit those are meant to be relative to the file itself.

This should also prevent to trigger a PHP include path search.

Attachments (3)

25068.001.patch (52.1 KB) - added by hakre 2 years ago.
25068.002.patch (52.4 KB) - added by hakre 2 years ago.
25068.002.2.patch (52.5 KB) - added by hakre 2 years ago.

Download all attachments as: .zip

Change History (9)

@hakre2 years ago

comment:1 follow-up: @nacin2 years ago

Looking good. A few points:

  • dirname( dirname( __FILE__ ) ) . '/foo' is preferred to dirname( __FILE__ ) . '/../'.
  • Once the bootstrap is available, we should use ABSPATH . 'wp-admin/admin-footer.php;' (et al), ABSPATH . WPINC, etc.

@hakre2 years ago

@hakre2 years ago

comment:2 @hakre2 years ago

Fine. The first point of your comment - double / triple / quadrupel dirname preference - is addressed with the latest attachment.

For the second point I need more pointers by you, e.g. 2-3 examples so I do see the issue. It's perhaps not worth the work for this issue and could be put into another one if you think this is worth to change.

comment:3 @ocean902 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #17092.

comment:4 follow-up: @ocean902 years ago

hakre, can you add your patches to #17092 please?

We should also take another look at the statement from sivel, ticket:17092:3.

comment:5 in reply to: ↑ 4 @hakre2 years ago

Replying to ocean90:

hakre, can you add your patches to #17092 please?

Yes.

We should also take another look at the statement from sivel, ticket:17092:3.

You mean the micro-optimization bs?

comment:6 in reply to: ↑ 1 @hakre2 years ago

Replying to nacin:

Looking good. A few points:

  • dirname( dirname( __FILE__ ) ) . '/foo' is preferred to dirname( __FILE__ ) . '/../'.
  • Once the bootstrap is available, we should use ABSPATH . 'wp-admin/admin-footer.php;' (et al), ABSPATH . WPINC, etc.

The patch is now on ticket #17092 http://core.trac.wordpress.org/attachment/ticket/17092/17092.001.patch

ABSPATH is now used as applicable.

I'm through with it, please give it some traction it's a hell of a work.

Note: See TracTickets for help on using tickets.