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 | 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)
Change History (7)
#2
@
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
@
16 years ago
- Milestone changed from Default Member Theme 1.0 to Default Member Theme 1.1
Moving this to 1.1.
Patch to allow members theme to accurately determine the location of wp-load.php, even if it's not in the docroot