Skip to content

Commit bc75594

Browse files
committed
Add edit_page cap check. Props josephscott. see WordPress#5313
git-svn-id: https://develop.svn.wordpress.org/trunk@6709 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d2067ba commit bc75594

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

xmlrpc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,10 +1379,13 @@ function mw_editPost($args) {
13791379
!empty($content_struct["post_type"])
13801380
&& ($content_struct["post_type"] == "page")
13811381
) {
1382+
if( !current_user_can( 'edit_page', $post_ID ) ) {
1383+
return(new IXR_Error(401, __("Sorry, you do not have the right to edit this page.")));
1384+
}
1385+
13821386
$post_type = "page";
13831387
}
13841388

1385-
// Edit page caps are checked in editPage. Just check post here.
13861389
if ( ( 'post' == $post_type ) && !current_user_can('edit_post', $post_ID) )
13871390
return new IXR_Error(401, __('Sorry, you can not edit this post.'));
13881391

0 commit comments

Comments
 (0)