Remove use of deprecated variables, don't show bookmarklet form to unrecognized browser.

git-svn-id: https://develop.svn.wordpress.org/trunk@3685 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2006-04-04 00:25:04 +00:00
parent 07a12ad2b1
commit d17b992895
3 changed files with 101 additions and 100 deletions

View File

@ -50,6 +50,8 @@ if ( $drafts = get_users_drafts( $user_ID ) ) { ?>
$post = get_default_post_to_edit();
include('edit-form-advanced.php');
?>
<?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
<div class="wrap">
<h3><?php _e('WordPress bookmarklet'); ?></h3>
<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p>
@ -87,4 +89,6 @@ window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=50
?>
</p>
</div>
<?php } ?>
<?php include('admin-footer.php'); ?>

View File

@ -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));

View File

@ -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) )