| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
if ( !defined('WP_MEMORY_LIMIT') ) |
|---|
| 13 |
define('WP_MEMORY_LIMIT', '32M'); |
|---|
| 14 |
|
|---|
| 15 |
if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) ) |
|---|
| 16 |
@ini_set('memory_limit', WP_MEMORY_LIMIT); |
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
function wp_unregister_GLOBALS() { |
|---|
| 27 |
if ( !ini_get('register_globals') ) |
|---|
| 28 |
return; |
|---|
| 29 |
|
|---|
| 30 |
if ( isset($_REQUEST['GLOBALS']) ) |
|---|
| 31 |
die('GLOBALS overwrite attempt detected'); |
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
$noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix'); |
|---|
| 35 |
|
|---|
| 36 |
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array()); |
|---|
| 37 |
foreach ( $input as $k => $v ) |
|---|
| 38 |
if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) { |
|---|
| 39 |
$GLOBALS[$k] = NULL; |
|---|
| 40 |
unset($GLOBALS[$k]); |
|---|
| 41 |
} |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
wp_unregister_GLOBALS(); |
|---|
| 45 |
|
|---|
| 46 |
unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
if ( ! isset($blog_id) ) |
|---|
| 56 |
$blog_id = 1; |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
if ( empty( $_SERVER['REQUEST_URI'] ) ) { |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { |
|---|
| 63 |
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { |
|---|
| 67 |
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; |
|---|
| 68 |
} |
|---|
| 69 |
else |
|---|
| 70 |
{ |
|---|
| 71 |
|
|---|
| 72 |
if ( isset($_SERVER['PATH_INFO']) ) { |
|---|
| 73 |
if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) |
|---|
| 74 |
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; |
|---|
| 75 |
else |
|---|
| 76 |
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; |
|---|
| 77 |
} |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { |
|---|
| 81 |
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|---|
| 82 |
} |
|---|
| 83 |
} |
|---|
| 84 |
} |
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) ) |
|---|
| 88 |
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; |
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false) |
|---|
| 92 |
unset($_SERVER['PATH_INFO']); |
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 |
$PHP_SELF = $_SERVER['PHP_SELF']; |
|---|
| 96 |
if ( empty($PHP_SELF) ) |
|---|
| 97 |
$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); |
|---|
| 98 |
|
|---|
| 99 |
if ( version_compare( '4.3', phpversion(), '>' ) ) { |
|---|
| 100 |
die( sprintf( 'Your server is running PHP version %s but WordPress requires at least 4.3.', php_version() ) ); |
|---|
| 101 |
} |
|---|
| 102 |
|
|---|
| 103 |
if ( !defined('WP_CONTENT_DIR') ) |
|---|
| 104 |
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); |
|---|
| 105 |
|
|---|
| 106 |
if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') ) |
|---|
| 107 |
die( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'); |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
function timer_start() { |
|---|
| 118 |
global $timestart; |
|---|
| 119 |
$mtime = explode(' ', microtime() ); |
|---|
| 120 |
$mtime = $mtime[1] + $mtime[0]; |
|---|
| 121 |
$timestart = $mtime; |
|---|
| 122 |
return true; |
|---|
| 123 |
} |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
function timer_stop($display = 0, $precision = 3) { |
|---|
| 150 |
global $timestart, $timeend; |
|---|
| 151 |
$mtime = microtime(); |
|---|
| 152 |
$mtime = explode(' ',$mtime); |
|---|
| 153 |
$mtime = $mtime[1] + $mtime[0]; |
|---|
| 154 |
$timeend = $mtime; |
|---|
| 155 |
$timetotal = $timeend-$timestart; |
|---|
| 156 |
$r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision); |
|---|
| 157 |
if ( $display ) |
|---|
| 158 |
echo $r; |
|---|
| 159 |
return $r; |
|---|
| 160 |
} |
|---|
| 161 |
timer_start(); |
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
if (defined('WP_DEBUG') and WP_DEBUG == true) { |
|---|
| 165 |
error_reporting(E_ALL); |
|---|
| 166 |
} else { |
|---|
| 167 |
error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); |
|---|
| 168 |
} |
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
if ( defined('WP_CACHE') ) |
|---|
| 172 |
@include WP_CONTENT_DIR . '/advanced-cache.php'; |
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
define('WPINC', 'wp-includes'); |
|---|
| 180 |
|
|---|
| 181 |
if ( !defined('WP_LANG_DIR') ) { |
|---|
| 182 |
|
|---|
| 183 |
* Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR |
|---|
| 184 |
* and uses that folder if it exists. Or it uses the "languages" folder in WPINC. |
|---|
| 185 |
* |
|---|
| 186 |
* @since 2.1.0 |
|---|
| 187 |
*/ |
|---|
| 188 |
if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) { |
|---|
| 189 |
define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); |
|---|
| 190 |
if (!defined('LANGDIR')) { |
|---|
| 191 |
|
|---|
| 192 |
define('LANGDIR', 'wp-content/languages'); |
|---|
| 193 |
} |
|---|
| 194 |
} else { |
|---|
| 195 |
define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); |
|---|
| 196 |
if (!defined('LANGDIR')) { |
|---|
| 197 |
|
|---|
| 198 |
define('LANGDIR', WPINC . '/languages'); |
|---|
| 199 |
} |
|---|
| 200 |
} |
|---|
| 201 |
} |
|---|
| 202 |
|
|---|
| 203 |
require (ABSPATH . WPINC . '/compat.php'); |
|---|
| 204 |
require (ABSPATH . WPINC . '/functions.php'); |
|---|
| 205 |
require (ABSPATH . WPINC . '/classes.php'); |
|---|
| 206 |
|
|---|
| 207 |
require_wp_db(); |
|---|
| 208 |
|
|---|
| 209 |
if ( !empty($wpdb->error) ) |
|---|
| 210 |
dead_db(); |
|---|
| 211 |
|
|---|
| 212 |
$prefix = $wpdb->set_prefix($table_prefix); |
|---|
| 213 |
|
|---|
| 214 |
if ( is_wp_error($prefix) ) |
|---|
| 215 |
wp_die('<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'); |
|---|
| 216 |
|
|---|
| 217 |
if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) |
|---|
| 218 |
require_once (WP_CONTENT_DIR . '/object-cache.php'); |
|---|
| 219 |
else |
|---|
| 220 |
require_once (ABSPATH . WPINC . '/cache.php'); |
|---|
| 221 |
|
|---|
| 222 |
wp_cache_init(); |
|---|
| 223 |
if ( function_exists('wp_cache_add_global_groups') ) { |
|---|
| 224 |
wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta')); |
|---|
| 225 |
wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); |
|---|
| 226 |
} |
|---|
| 227 |
|
|---|
| 228 |
require (ABSPATH . WPINC . '/plugin.php'); |
|---|
| 229 |
require (ABSPATH . WPINC . '/default-filters.php'); |
|---|
| 230 |
include_once(ABSPATH . WPINC . '/streams.php'); |
|---|
| 231 |
include_once(ABSPATH . WPINC . '/gettext.php'); |
|---|
| 232 |
require_once (ABSPATH . WPINC . '/l10n.php'); |
|---|
| 233 |
|
|---|
| 234 |
if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { |
|---|
| 235 |
if ( defined('WP_SITEURL') ) |
|---|
| 236 |
$link = WP_SITEURL . '/wp-admin/install.php'; |
|---|
| 237 |
elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) |
|---|
| 238 |
$link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; |
|---|
| 239 |
else |
|---|
| 240 |
$link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; |
|---|
| 241 |
require_once(ABSPATH . WPINC . '/kses.php'); |
|---|
| 242 |
require_once(ABSPATH . WPINC . '/pluggable.php'); |
|---|
| 243 |
wp_redirect($link); |
|---|
| 244 |
die(); |
|---|
| 245 |
} |
|---|
| 246 |
|
|---|
| 247 |
require (ABSPATH . WPINC . '/formatting.php'); |
|---|
| 248 |
require (ABSPATH . WPINC . '/capabilities.php'); |
|---|
| 249 |
require (ABSPATH . WPINC . '/query.php'); |
|---|
| 250 |
require (ABSPATH . WPINC . '/theme.php'); |
|---|
| 251 |
require (ABSPATH . WPINC . '/user.php'); |
|---|
| 252 |
require (ABSPATH . WPINC . '/general-template.php'); |
|---|
| 253 |
require (ABSPATH . WPINC . '/link-template.php'); |
|---|
| 254 |
require (ABSPATH . WPINC . '/author-template.php'); |
|---|
| 255 |
require (ABSPATH . WPINC . '/post.php'); |
|---|
| 256 |
require (ABSPATH . WPINC . '/post-template.php'); |
|---|
| 257 |
require (ABSPATH . WPINC . '/category.php'); |
|---|
| 258 |
require (ABSPATH . WPINC . '/category-template.php'); |
|---|
| 259 |
require (ABSPATH . WPINC . '/comment.php'); |
|---|
| 260 |
require (ABSPATH . WPINC . '/comment-template.php'); |
|---|
| 261 |
require (ABSPATH . WPINC . '/rewrite.php'); |
|---|
| 262 |
require (ABSPATH . WPINC . '/feed.php'); |
|---|
| 263 |
require (ABSPATH . WPINC . '/bookmark.php'); |
|---|
| 264 |
require (ABSPATH . WPINC . '/bookmark-template.php'); |
|---|
| 265 |
require (ABSPATH . WPINC . '/kses.php'); |
|---|
| 266 |
require (ABSPATH . WPINC . '/cron.php'); |
|---|
| 267 |
require (ABSPATH . WPINC . '/version.php'); |
|---|
| 268 |
require (ABSPATH . WPINC . '/deprecated.php'); |
|---|
| 269 |
require (ABSPATH . WPINC . '/script-loader.php'); |
|---|
| 270 |
require (ABSPATH . WPINC . '/taxonomy.php'); |
|---|
| 271 |
require (ABSPATH . WPINC . '/update.php'); |
|---|
| 272 |
require (ABSPATH . WPINC . '/canonical.php'); |
|---|
| 273 |
require (ABSPATH . WPINC . '/shortcodes.php'); |
|---|
| 274 |
require (ABSPATH . WPINC . '/media.php'); |
|---|
| 275 |
|
|---|
| 276 |
if ( !defined('WP_CONTENT_URL') ) |
|---|
| 277 |
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); |
|---|
| 278 |
|
|---|
| 279 |
/** |
|---|
| 280 |
* Allows for the plugins directory to be moved from the default location. |
|---|
| 281 |
* |
|---|
| 282 |
* @since 2.6 |
|---|
| 283 |
*/ |
|---|
| 284 |
if ( !defined('WP_PLUGIN_DIR') ) |
|---|
| 285 |
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); |
|---|
| 286 |
if ( !defined('WP_PLUGIN_URL') ) |
|---|
| 287 |
define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); |
|---|
| 288 |
if ( !defined('PLUGINDIR') ) |
|---|
| 289 |
define( 'PLUGINDIR', 'wp-content/plugins' ); |
|---|
| 290 |
|
|---|
| 291 |
if ( ! defined('WP_INSTALLING') ) { |
|---|
| 292 |
|
|---|
| 293 |
$cookiehash = md5(get_option('siteurl')); |
|---|
| 294 |
|
|---|
| 295 |
* Used to guarantee unique hash cookies |
|---|
| 296 |
* @since 1.5 |
|---|
| 297 |
*/ |
|---|
| 298 |
define('COOKIEHASH', $cookiehash); |
|---|
| 299 |
} |
|---|
| 300 |
|
|---|
| 301 |
|
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
$wp_default_secret_key = 'put your unique phrase here'; |
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 |
|
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 |
if ( !defined('USER_COOKIE') ) |
|---|
| 312 |
define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); |
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 |
if ( !defined('PASS_COOKIE') ) |
|---|
| 319 |
define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); |
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
|
|---|
| 325 |
if ( !defined('AUTH_COOKIE') ) |
|---|
| 326 |
define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); |
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
|
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 |
if ( !defined('SECURE_AUTH_COOKIE') ) |
|---|
| 333 |
define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); |
|---|
| 334 |
|
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 |
if ( !defined('LOGGED_IN_COOKIE') ) |
|---|
| 340 |
define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); |
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
if ( !defined('TEST_COOKIE') ) |
|---|
| 347 |
define('TEST_COOKIE', 'wordpress_test_cookie'); |
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
if ( !defined('COOKIEPATH') ) |
|---|
| 354 |
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); |
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
if ( !defined('SITECOOKIEPATH') ) |
|---|
| 361 |
define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); |
|---|
| 362 |
|
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
|
|---|
| 367 |
if ( !defined('ADMIN_COOKIE_PATH') ) |
|---|
| 368 |
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); |
|---|
| 369 |
|
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 |
if ( !defined('PLUGINS_COOKIE_PATH') ) |
|---|
| 375 |
define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); |
|---|
| 376 |
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
if ( !defined('COOKIE_DOMAIN') ) |
|---|
| 382 |
define('COOKIE_DOMAIN', false); |
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
if ( !defined('FORCE_SSL_ADMIN') ) |
|---|
| 389 |
define('FORCE_SSL_ADMIN', false); |
|---|
| 390 |
force_ssl_admin(FORCE_SSL_ADMIN); |
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
if ( !defined('FORCE_SSL_LOGIN') ) |
|---|
| 397 |
define('FORCE_SSL_LOGIN', false); |
|---|
| 398 |
force_ssl_login(FORCE_SSL_LOGIN); |
|---|
| 399 |
|
|---|
| 400 |
|
|---|
| 401 |
|
|---|
| 402 |
|
|---|
| 403 |
|
|---|
| 404 |
if ( !defined( 'AUTOSAVE_INTERVAL' ) ) |
|---|
| 405 |
define( 'AUTOSAVE_INTERVAL', 60 ); |
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 |
require (ABSPATH . WPINC . '/vars.php'); |
|---|
| 409 |
|
|---|
| 410 |
|
|---|
| 411 |
if (get_option('hack_file')) { |
|---|
| 412 |
if (file_exists(ABSPATH . 'my-hacks.php')) |
|---|
| 413 |
require(ABSPATH . 'my-hacks.php'); |
|---|
| 414 |
} |
|---|
| 415 |
|
|---|
| 416 |
if ( get_option('active_plugins') ) { |
|---|
| 417 |
$current_plugins = get_option('active_plugins'); |
|---|
| 418 |
if ( is_array($current_plugins) ) { |
|---|
| 419 |
foreach ($current_plugins as $plugin) { |
|---|
| 420 |
if ('' != $plugin && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) |
|---|
| 421 |
include_once(WP_PLUGIN_DIR . '/' . $plugin); |
|---|
| 422 |
} |
|---|
| 423 |
} |
|---|
| 424 |
} |
|---|
| 425 |
|
|---|
| 426 |
require (ABSPATH . WPINC . '/pluggable.php'); |
|---|
| 427 |
|
|---|
| 428 |
|
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 |
|
|---|
| 432 |
if (function_exists('mb_internal_encoding')) { |
|---|
| 433 |
if (!@mb_internal_encoding(get_option('blog_charset'))) |
|---|
| 434 |
mb_internal_encoding('UTF-8'); |
|---|
| 435 |
} |
|---|
| 436 |
|
|---|
| 437 |
|
|---|
| 438 |
if ( defined('WP_CACHE') && function_exists('wp_cache_postload') ) |
|---|
| 439 |
wp_cache_postload(); |
|---|
| 440 |
|
|---|
| 441 |
do_action('plugins_loaded'); |
|---|
| 442 |
|
|---|
| 443 |
$default_constants = array( 'WP_POST_REVISIONS' => true ); |
|---|
| 444 |
foreach ( $default_constants as $c => $v ) |
|---|
| 445 |
@define( $c, $v ); |
|---|
| 446 |
unset($default_constants, $c, $v); |
|---|
| 447 |
|
|---|
| 448 |
|
|---|
| 449 |
if ( get_magic_quotes_gpc() ) { |
|---|
| 450 |
$_GET = stripslashes_deep($_GET ); |
|---|
| 451 |
$_POST = stripslashes_deep($_POST ); |
|---|
| 452 |
$_COOKIE = stripslashes_deep($_COOKIE); |
|---|
| 453 |
} |
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
$_GET = add_magic_quotes($_GET ); |
|---|
| 457 |
$_POST = add_magic_quotes($_POST ); |
|---|
| 458 |
$_COOKIE = add_magic_quotes($_COOKIE); |
|---|
| 459 |
$_SERVER = add_magic_quotes($_SERVER); |
|---|
| 460 |
|
|---|
| 461 |
do_action('sanitize_comment_cookies'); |
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 |
$wp_the_query =& new WP_Query(); |
|---|
| 469 |
|
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
$wp_query =& $wp_the_query; |
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
$wp_rewrite =& new WP_Rewrite(); |
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 |
$wp =& new WP(); |
|---|
| 491 |
|
|---|
| 492 |
do_action('setup_theme'); |
|---|
| 493 |
|
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 |
|
|---|
| 497 |
|
|---|
| 498 |
define('TEMPLATEPATH', get_template_directory()); |
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
|
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 |
define('STYLESHEETPATH', get_stylesheet_directory()); |
|---|
| 505 |
|
|---|
| 506 |
|
|---|
| 507 |
load_default_textdomain(); |
|---|
| 508 |
|
|---|
| 509 |
|
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 |
$locale = get_locale(); |
|---|
| 514 |
$locale_file = WP_LANG_DIR . "/$locale.php"; |
|---|
| 515 |
if ( is_readable($locale_file) ) |
|---|
| 516 |
require_once($locale_file); |
|---|
| 517 |
|
|---|
| 518 |
|
|---|
| 519 |
require_once(ABSPATH . WPINC . '/locale.php'); |
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
|
|---|
| 523 |
|
|---|
| 524 |
|
|---|
| 525 |
|
|---|
| 526 |
$wp_locale =& new WP_Locale(); |
|---|
| 527 |
|
|---|
| 528 |
|
|---|
| 529 |
if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) |
|---|
| 530 |
include(STYLESHEETPATH . '/functions.php'); |
|---|
| 531 |
if ( file_exists(TEMPLATEPATH . '/functions.php') ) |
|---|
| 532 |
include(TEMPLATEPATH . '/functions.php'); |
|---|
| 533 |
|
|---|
| 534 |
|
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
|
|---|
| 540 |
function shutdown_action_hook() { |
|---|
| 541 |
do_action('shutdown'); |
|---|
| 542 |
wp_cache_close(); |
|---|
| 543 |
} |
|---|
| 544 |
register_shutdown_function('shutdown_action_hook'); |
|---|
| 545 |
|
|---|
| 546 |
$wp->init(); |
|---|
| 547 |
|
|---|
| 548 |
// Everything is loaded and initialized. |
|---|
| 549 |
do_action('init'); |
|---|
| 550 |
|
|---|
| 551 |
?> |
|---|
| 552 |
|
|---|