forked from WordPress/WordPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp_index.php
46 lines (40 loc) · 1.57 KB
/
wp_index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
if ( ! ( defined( '_JEXEC' ) ) ) { die( 'Direct Access to this location is not allowed.' ); }
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/* rc_corephp - This is for when we have multisite enabled */
if ( isset( $_SERVER['WPPRE_SCRIPT_FILENAME'] ) ) {
// Store Joomla's
$_SERVER['JPRE_SCRIPT_FILENAME'] = $_SERVER['SCRIPT_FILENAME'];
$_SERVER['JPRE_REQUEST_URI'] = $_SERVER['REQUEST_URI'];
$_SERVER['JPRE_SCRIPT_NAME'] = $_SERVER['SCRIPT_NAME'];
$_SERVER['JPRE_PHP_SELF'] = $_SERVER['PHP_SELF'];
// Set wordpress request
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['WPPRE_SCRIPT_FILENAME'];
$_SERVER['REQUEST_URI'] = $_SERVER['WPPRE_REQUEST_URI'];
$_SERVER['SCRIPT_NAME'] = $_SERVER['WPPRE_SCRIPT_NAME'];
$_SERVER['PHP_SELF'] = $_SERVER['WPPRE_PHP_SELF'];
}
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
/* rc_removed ./ before the require */
require('wp-blog-header.php');
if ( isset( $_SERVER['JPRE_SCRIPT_FILENAME'] ) ) {
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['JPRE_SCRIPT_FILENAME'];
$_SERVER['REQUEST_URI'] = dirname( dirname( $_SERVER['JPRE_REQUEST_URI'] ) ) . 'index.php';
$_SERVER['SCRIPT_NAME'] = $_SERVER['JPRE_SCRIPT_NAME'];
$_SERVER['PHP_SELF'] = $_SERVER['JPRE_PHP_SELF'];
// Set the original path - Experimental
$uri = JURI::getInstance();
$uri->setPath( trailingslashit( JURI::root( true ) ) );
}
?>