From 877e6a711a5a6545ceaf88842e4d44223ee9f05f Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 9 Aug 2005 08:26:54 +0000 Subject: [PATCH] Turn register globals off. Hat tip: Christian Schmidt git-svn-id: http://svn.automattic.com/wordpress/trunk@2768 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-settings.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-settings.php b/wp-settings.php index 252918705..f7bcb0fc2 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -3,6 +3,10 @@ $HTTP_HOST = getenv('HTTP_HOST'); /* domain name */ $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */ $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */ +// Turn register globals off - Christian Schmidt +foreach ( array_merge($_REQUEST, $_SERVER, $_ENV) as $name => $value ) + unset($$name); + // Fix for IIS, which doesn't set REQUEST_URI if ( empty( $_SERVER['REQUEST_URI'] ) ) { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI? @@ -69,6 +73,8 @@ $tablelinkcategories = $wpdb->linkcategories; $tableoptions = $wpdb->options; $tablepostmeta = $wpdb->postmeta; +$wp_filters = array(); + require (ABSPATH . WPINC . '/functions.php'); require (ABSPATH . WPINC . '/default-filters.php'); require_once (ABSPATH . WPINC . '/wp-l10n.php');