summaryrefslogtreecommitdiffstats
path: root/wp-includes/vars.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-03-12 23:03:30 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-03-12 23:03:30 +0000
commit0d4bfdbf8c17706b57e92838d1599cb9e82c893b (patch)
treef02f84d4c598373d7e5921ea3d3e66fd50850d24 /wp-includes/vars.php
parentbed8532fd2d9cc526a74f4fc4214887b37cf6e71 (diff)
downloadwordpress-mu-0d4bfdbf8c17706b57e92838d1599cb9e82c893b.tar.gz
wordpress-mu-0d4bfdbf8c17706b57e92838d1599cb9e82c893b.tar.xz
wordpress-mu-0d4bfdbf8c17706b57e92838d1599cb9e82c893b.zip
WP Merge to 5028
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@915 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/vars.php')
-rw-r--r--wp-includes/vars.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/wp-includes/vars.php b/wp-includes/vars.php
index 1675ca4..26f0fa0 100644
--- a/wp-includes/vars.php
+++ b/wp-includes/vars.php
@@ -13,27 +13,27 @@ if ( preg_match('#([^/]+\.php)$#', $PHP_SELF, $self_matches) ) {
}
// Simple browser detection
-// We should probably be doing true/false instead of 1/0 here ~ Mark
-$is_lynx = 0; $is_gecko = 0; $is_winIE = 0; $is_macIE = 0; $is_opera = 0; $is_NS4 = 0;
+$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = false;
-if ( preg_match('/Lynx/', $_SERVER['HTTP_USER_AGENT']) )
- $is_lynx = 1;
-elseif ( preg_match('/Gecko/', $_SERVER['HTTP_USER_AGENT']) )
- $is_gecko = 1;
-elseif ( preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && preg_match('/Win/', $_SERVER['HTTP_USER_AGENT']) )
- $is_winIE = 1;
-elseif ( preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && preg_match('/Mac/', $_SERVER['HTTP_USER_AGENT']) )
- $is_macIE = 1;
-elseif ( preg_match('/Opera/', $_SERVER['HTTP_USER_AGENT']) )
- $is_opera = 1;
-elseif ( preg_match('/Nav/', $_SERVER['HTTP_USER_AGENT']) || preg_match('/Mozilla\/4\./', $_SERVER['HTTP_USER_AGENT']) )
- $is_NS4 = 1;
+if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
+ $is_lynx = true;
+} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) {
+ $is_gecko = true;
+} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win')) {
+ $is_winIE = true;
+} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
+ $is_macIE = true;
+} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
+ $is_opera = true;
+} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false) {
+ $is_NS4 = true;
+}
$is_IE = ( $is_macIE || $is_winIE );
// Server detection
-$is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? 1 : 0;
-$is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? 1 : 0;
+$is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? true : false;
+$is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? true : false;
// if the config file does not provide the smilies array, let's define it here
if (!isset($wpsmiliestrans)) {