X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/cc7b1505cd9fafd87c3672f669e13e98b0c544f7..refs/tags/wordpress-3.4:/wp-includes/vars.php diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 2573b27e..7585793d 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -1,100 +1,126 @@ 'icon_mrgreen.gif', - ':neutral:' => 'icon_neutral.gif', - ':twisted:' => 'icon_twisted.gif', - ':arrow:' => 'icon_arrow.gif', - ':shock:' => 'icon_eek.gif', - ':smile:' => 'icon_smile.gif', - ' :???:' => 'icon_confused.gif', - ':cool:' => 'icon_cool.gif', - ':evil:' => 'icon_evil.gif', - ':grin:' => 'icon_biggrin.gif', - ':idea:' => 'icon_idea.gif', - ':oops:' => 'icon_redface.gif', - ':razz:' => 'icon_razz.gif', - ':roll:' => 'icon_rolleyes.gif', - ':wink:' => 'icon_wink.gif', - ':cry:' => 'icon_cry.gif', - ':eek:' => 'icon_surprised.gif', - ':lol:' => 'icon_lol.gif', - ':mad:' => 'icon_mad.gif', - ':sad:' => 'icon_sad.gif', - ' 8-)' => 'icon_cool.gif', - ' 8-O' => 'icon_eek.gif', - ' :-(' => 'icon_sad.gif', - ' :-)' => 'icon_smile.gif', - ' :-?' => 'icon_confused.gif', - ' :-D' => 'icon_biggrin.gif', - ' :-P' => 'icon_razz.gif', - ' :-o' => 'icon_surprised.gif', - ' :-x' => 'icon_mad.gif', - ' :-|' => 'icon_neutral.gif', - ' ;-)' => 'icon_wink.gif', - ' 8)' => 'icon_cool.gif', - ' 8O' => 'icon_eek.gif', - ' :(' => 'icon_sad.gif', - ' :)' => 'icon_smile.gif', - ' :?' => 'icon_confused.gif', - ' :D' => 'icon_biggrin.gif', - ' :P' => 'icon_razz.gif', - ' :o' => 'icon_surprised.gif', - ' :x' => 'icon_mad.gif', - ' :|' => 'icon_neutral.gif', - ' ;)' => 'icon_wink.gif', - ':!:' => 'icon_exclaim.gif', - ':?:' => 'icon_question.gif', - ); -} +/** + * Whether the server software is IIS or something else + * @global bool $is_IIS + */ +$is_IIS = !$is_apache && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false); +/** + * Whether the server software is IIS 7.X + * @global bool $is_iis7 + */ +$is_iis7 = $is_IIS && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false); -// generates smilies' search & replace arrays -foreach($wpsmiliestrans as $smiley => $img) { - $wp_smiliessearch[] = $smiley; - $smiley_masked = htmlspecialchars( trim($smiley) , ENT_QUOTES); - $wp_smiliesreplace[] = " $smiley_masked "; -} +/** + * Test if the current browser runs on a mobile device (smart phone, tablet, etc.) + * + * @return bool true|false + */ +function wp_is_mobile() { + static $is_mobile; + + if ( isset($is_mobile) ) + return $is_mobile; -?> + if ( empty($_SERVER['HTTP_USER_AGENT']) ) { + $is_mobile = false; + } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // many mobile devices (all iPhone, iPad, etc.) + || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false + || strpos($_SERVER['HTTP_USER_AGENT'], 'Silk/') !== false + || strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false + || strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false + || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false ) { + $is_mobile = true; + } else { + $is_mobile = false; + } + + return $is_mobile; +}