mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-19 09:05:22 +01:00
d8e55fcfdc
git-svn-id: http://svn.automattic.com/wordpress/trunk@5063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
38 lines
1.4 KiB
PHP
38 lines
1.4 KiB
PHP
<?php
|
|
|
|
// On which page are we ?
|
|
if ( preg_match('#([^/]+\.php)$#', $PHP_SELF, $self_matches) ) {
|
|
$pagenow = $self_matches[1];
|
|
} elseif ( strpos($PHP_SELF, '?') !== false ) {
|
|
$pagenow = explode('/', $PHP_SELF);
|
|
$pagenow = trim($pagenow[(sizeof($pagenow)-1)]);
|
|
$pagenow = explode('?', $pagenow);
|
|
$pagenow = $pagenow[0];
|
|
} else {
|
|
$pagenow = 'index.php';
|
|
}
|
|
|
|
// Simple browser detection
|
|
$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = false;
|
|
|
|
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') !== false) {
|
|
$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)) ? true : false;
|
|
$is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? true : false;
|
|
|
|
?>
|