-
+ 7DD482476DD8FE398B33AF501D2F22D3F2CCCBD425F9B29C021C21F561343E95095928A742CB3067CF7A87652A2DB26150740FDD57893CA7F544A8E9BADBF97E
mp-wp/wp-includes/vars.php
(0 . 0)(1 . 76)
155927 <?php
155928 /**
155929 * Creates common globals for the rest of WordPress
155930 *
155931 * Sets $pagenow global which is the current page. Checks
155932 * for the browser to set which one is currently being used.
155933 *
155934 * Detects which user environment WordPress is being used on.
155935 * Only attempts to check for Apache and IIS. Two web servers
155936 * with known permalink capability.
155937 *
155938 * @package WordPress
155939 */
155940
155941 // On which page are we ?
155942 if ( is_admin() ) {
155943 // wp-admin pages are checked more carefully
155944 preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
155945 $pagenow = $self_matches[1];
155946 $pagenow = preg_replace('#\?.*?$#', '', $pagenow);
155947 if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {
155948 $pagenow = 'index.php';
155949 } else {
155950 preg_match('#(.*?)(/|$)#', $pagenow, $self_matches);
155951 $pagenow = strtolower($self_matches[1]);
155952 if ( '.php' !== substr($pagenow, -4, 4) )
155953 $pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried)
155954 }
155955 } else {
155956 if ( preg_match('#([^/]+\.php)([?/].*?)?$#i', $PHP_SELF, $self_matches) )
155957 $pagenow = strtolower($self_matches[1]);
155958 else
155959 $pagenow = 'index.php';
155960 }
155961
155962 // Simple browser detection
155963 $is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false;
155964
155965 if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
155966 $is_lynx = true;
155967 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
155968 $is_chrome = true;
155969 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) {
155970 $is_safari = true;
155971 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) {
155972 $is_gecko = true;
155973 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false) {
155974 $is_winIE = true;
155975 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
155976 $is_macIE = true;
155977 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
155978 $is_opera = true;
155979 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false) {
155980 $is_NS4 = true;
155981 }
155982
155983 if ( $is_safari && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') !== false )
155984 $is_iphone = true;
155985
155986 $is_IE = ( $is_macIE || $is_winIE );
155987
155988 // Server detection
155989
155990 /**
155991 * Whether the server software is Apache or something else
155992 * @global bool $is_apache
155993 */
155994 $is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? true : false;
155995
155996 /**
155997 * Whether the server software is IIS or something else
155998 * @global bool $is_IIS
155999 */
156000 $is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? true : false;
156001
156002 ?>