Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#25068 closed defect (bug) (duplicate)

Require relative to working directory, not file

Reported by: hakre's profile 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 11 years ago.
25068.002.patch (52.4 KB) - added by hakre 11 years ago.
25068.002.2.patch (52.5 KB) - added by hakre 11 years ago.

Download all attachments as: .zip

Change History (9)

@hakre
11 years ago

#1 follow-up: @nacin
11 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.

@hakre
11 years ago

@hakre
11 years ago

#2 @hakre
11 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.

#3 @ocean90
11 years ago

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

Duplicate of #17092.

#4 follow-up: @ocean90
11 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.

#5 in reply to: ↑ 4 @hakre
11 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?

#6 in reply to: ↑ 1 @hakre
11 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.