Add nonce and gettext to sidebar.php. Fix sidebar redirect.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-26 23:41:41 +00:00
parent f43fba3559
commit 74cff8bd3c
2 changed files with 13 additions and 11 deletions

View File

@ -14,9 +14,9 @@ function redirect_post($post_ID = '') {
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
if ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'bookmarklet' == $_POST['mode'] ) {
if ( !empty($_POST['mode']) && 'bookmarklet' == $_POST['mode'] ) {
$location = $_POST['referredby'];
} elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
} elseif ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
$location = 'sidebar.php?a=b';
} elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false )

View File

@ -12,15 +12,15 @@ if ('b' == $_GET['a']) {
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" />
<title>WordPress &#8250; Posted</title>
<title><?php _e('WordPress &#8250; Posted'); ?></title>
<?php
wp_admin_css( 'css/global' );
wp_admin_css();
?>
</head>
<body>
<p>Posted !</p>
<p><a href="sidebar.php">Click here</a> to post again.</p>
<p><?php _e('Posted !'); ?></p>
<p><?php printf(__('<a href="%s">Click here</a> to post again.'), 'sidebar.php'); ?></p>
</body>
</html><?php
@ -30,7 +30,7 @@ wp_admin_css();
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
<title>WordPress &#8250; Sidebar</title>
<title><?php _e('WordPress &#8250; Sidebar'); ?></title>
<?php
wp_admin_css( 'css/global' );
wp_admin_css();
@ -55,13 +55,15 @@ form {
<body id="sidebar">
<h1 id="wphead"><a href="http://wordpress.org/" rel="external">WordPress</a></h1>
<form name="post" action="post.php" method="post">
<div><input type="hidden" name="action" value="post" />
<div>
<input type="hidden" name="action" value="post" />
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="mode" value="sidebar" />
<p>Title:
<?php wp_nonce_field('add-post'); ?>
<p><?php _e('Title:'); ?>
<input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" />
</p>
<p>Categories:
<p><?php _e('Categories:'); ?>
<span class="sidebar-categories">
<?php dropdown_categories(); ?>
</span>
@ -71,9 +73,9 @@ Post:
<textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea>
</p>
<p>
<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft'); ?>" />
<?php if ( current_user_can('publish_posts') ) : ?>
<input name="publish" type="submit" id="publish" tabindex="6" value="Publish" class="button button-highlighted" />
<input name="publish" type="submit" id="publish" tabindex="6" value="<?php _e('Publish') ?>" class="button button-highlighted" />
<?php endif; ?>
</p>
</div>