From c9a29b0123cd84b9e9d83b8f1ef98d59ebba1545 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 6 Jul 2015 22:41:25 +0000 Subject: [PATCH] Check for all required caps before (un)sticking a post. In cases where a user has the `edit_others_posts` capability but not `publish_posts`, it was possible for that user to unstick a post after editing, since the input field was never made available in that context. Props ericmann, chriscct7. Fixes #24153. Built from https://develop.svn.wordpress.org/trunk@33096 git-svn-id: http://core.svn.wordpress.org/trunk@33067 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 2ab53352ad..1968e9662e 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -385,7 +385,7 @@ function edit_post( $post_data = null ) { wp_set_post_lock( $post_ID ); - if ( current_user_can( $ptype->cap->edit_others_posts ) ) { + if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) { if ( ! empty( $post_data['sticky'] ) ) stick_post( $post_ID ); else diff --git a/wp-includes/version.php b/wp-includes/version.php index f88e2e8a98..efa822a389 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta1-33095'; +$wp_version = '4.3-beta1-33096'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.