Skip to content

Commit 7b45977

Browse files
committed
Validate post status against capabilities in press this. Props nacin. for 3.1
git-svn-id: https://develop.svn.wordpress.org/branches/3.1@17710 602fd350-edb4-49c9-b593-d223f7449a82
1 parent fbc02c0 commit 7b45977

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

wp-admin/press-this.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ function press_it() {
5656
}
5757
}
5858
// set the post_content and status
59-
$quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
59+
if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) )
60+
$quick['post_status'] = 'publish';
61+
elseif ( isset( $_POST['review'] ) )
62+
$quick['post_status'] = 'pending';
63+
else
64+
$quick['post_status'] = 'draft';
6065
$quick['post_content'] = $content;
6166
// error handling for media_sideload
6267
if ( is_wp_error($upload) ) {

0 commit comments

Comments
 (0)