From 9591f04a8fcbd65696cf7c726c6e1f0b2f2609e6 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 6 Jul 2006 00:08:53 +0000 Subject: [PATCH] Use HTTP_USER_AGENT from _SERVER. git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3991 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/vars.php | 16 +++++++--------- wp-settings.php | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/wp-includes/vars.php b/wp-includes/vars.php index e8c97cf3d4..2573b27eb3 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -14,20 +14,18 @@ if (preg_match('#([^/]+\.php)$#', $PHP_SELF, $self_matches)) { // Simple browser detection $is_lynx = 0; $is_gecko = 0; $is_winIE = 0; $is_macIE = 0; $is_opera = 0; $is_NS4 = 0; -if (!isset($HTTP_USER_AGENT)) { - $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; -} -if (preg_match('/Lynx/', $HTTP_USER_AGENT)) { + +if (preg_match('/Lynx/', $_SERVER['HTTP_USER_AGENT'])) { $is_lynx = 1; -} elseif (preg_match('/Gecko/', $HTTP_USER_AGENT)) { +} elseif (preg_match('/Gecko/', $_SERVER['HTTP_USER_AGENT'])) { $is_gecko = 1; -} elseif ((preg_match('/MSIE/', $HTTP_USER_AGENT)) && (preg_match('/Win/', $HTTP_USER_AGENT))) { +} elseif ((preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) && (preg_match('/Win/', $_SERVER['HTTP_USER_AGENT']))) { $is_winIE = 1; -} elseif ((preg_match('/MSIE/', $HTTP_USER_AGENT)) && (preg_match('/Mac/', $HTTP_USER_AGENT))) { +} elseif ((preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) && (preg_match('/Mac/', $_SERVER['HTTP_USER_AGENT']))) { $is_macIE = 1; -} elseif (preg_match('/Opera/', $HTTP_USER_AGENT)) { +} elseif (preg_match('/Opera/', $_SERVER['HTTP_USER_AGENT'])) { $is_opera = 1; -} elseif ((preg_match('/Nav/', $HTTP_USER_AGENT) ) || (preg_match('/Mozilla\/4\./', $HTTP_USER_AGENT))) { +} elseif ((preg_match('/Nav/', $_SERVER['HTTP_USER_AGENT']) ) || (preg_match('/Mozilla\/4\./', $_SERVER['HTTP_USER_AGENT']))) { $is_NS4 = 1; } $is_IE = (($is_macIE) || ($is_winIE)); diff --git a/wp-settings.php b/wp-settings.php index e5a28773b5..f01ccb7e32 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -18,7 +18,6 @@ function unregister_GLOBALS() { unregister_GLOBALS(); -$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); unset( $wp_filter, $cache_userdata, $cache_lastcommentmodified, $cache_lastpostdate, $cache_settings, $category_cache, $cache_categories ); if ( ! isset($blog_id) )