From bc7559450412aade68b3f90a38f3b8bf2bdccb1d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 2 Feb 2008 17:55:40 +0000 Subject: [PATCH] Add edit_page cap check. Props josephscott. see #5313 git-svn-id: https://develop.svn.wordpress.org/trunk@6709 602fd350-edb4-49c9-b593-d223f7449a82 --- xmlrpc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmlrpc.php b/xmlrpc.php index 969b41181d..e1834ab06c 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -1379,10 +1379,13 @@ class wp_xmlrpc_server extends IXR_Server { !empty($content_struct["post_type"]) && ($content_struct["post_type"] == "page") ) { + if( !current_user_can( 'edit_page', $post_ID ) ) { + return(new IXR_Error(401, __("Sorry, you do not have the right to edit this page."))); + } + $post_type = "page"; } - // Edit page caps are checked in editPage. Just check post here. if ( ( 'post' == $post_type ) && !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you can not edit this post.'));