WordPress.org

Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 20 months 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 20 months ago.
25068.002.patch (52.4 KB) - added by hakre 20 months ago.
25068.002.2.patch (52.5 KB) - added by hakre 20 months ago.

Download all attachments as: .zip

Change History (9)

@hakre20 months ago

comment:1 follow-up: @nacin20 months 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.

@hakre20 months ago

@hakre20 months ago

comment:2 @hakre20 months 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 @ocean9020 months ago

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

Duplicate of #17092.

comment:4 follow-up: @ocean9020 months 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 @hakre20 months 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 @hakre20 months 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.