Skip to:
Content

BuddyPress.org

Opened 16 years ago

Closed 15 years ago

#480 closed enhancement (no action required)

loader.php cannot accurately guess the location of wp-load.php

Reported by: simonwheatley's profile simonwheatley Owned by:
Milestone: 1.1 Priority: minor
Severity: Version:
Component: Keywords: has-patch, 2nd-opinion
Cc: simon@…

Description

The CSS for member themes is loaded by adding the following into style.css:

@import url(css/loader.php);

The file loader.php then requires wp-load.php as follows:

require_once( preg_replace('%(.*)[/\\\\]wp-content[/\\\\].*%', '\1', $_SERVER['SCRIPT_FILENAME'] ) . '/wp-load.php' );

Unfortunately this doesn't cover the situation where the WordPress Mu files are not on the site root, as covered here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

I propose the following: Add a filter to functions.php in the member theme to change the main CSS file directly to css/loader.php, also pass the directory path for WP as a GET param. Currently the entire directory path is passed, which could be perceived to be a security hazard, so maybe just the path relative to docroot should be passed?

Attachments (1)

fix-members-css.diff (2.3 KB) - added by simonwheatley 16 years ago.
Patch to allow members theme to accurately determine the location of wp-load.php, even if it's not in the docroot

Download all attachments as: .zip

Change History (7)

@simonwheatley
16 years ago

Patch to allow members theme to accurately determine the location of wp-load.php, even if it's not in the docroot

#1 @simonwheatley
16 years ago

  • Cc simon@… added

#2 @simonwheatley
16 years ago

  • Priority changed from major to minor
  • Type changed from defect to enhancement

Since opening this ticket I've realised that WPMu doesnt like living in a separate folder, ala WP. However I still think this patch simplifies the loading of the CSS by removing an HTTP call.

I guess things could be simplified still further by refactoring the provided function (see patch) to perform the tasks which loader.php does.

#3 @apeatling
16 years ago

  • Milestone changed from Default Member Theme 1.0 to Default Member Theme 1.1

Moving this to 1.1.

#4 @(none)
15 years ago

  • Milestone Default Member Theme 1.1 deleted

Milestone Default Member Theme 1.1 deleted

#5 @DJPaul
15 years ago

  • Milestone set to 1.1

Does this still apply with the BP 1.1 theme changes?

#6 @apeatling
15 years ago

  • Resolution set to invalid
  • Status changed from new to closed

invalid now.

Note: See TracTickets for help on using tickets.