WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

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

Download all attachments as: .zip

Change History (9)

hakre8 months ago

comment:1 follow-up: nacin8 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.

hakre8 months ago

hakre8 months ago

comment:2 hakre8 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 ocean908 months ago

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

Duplicate of #17092.

comment:4 follow-up: ocean908 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 hakre8 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 hakre8 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.