XML-RPC: For wp.getOptions, set readonly to true for writable options that the user does not have permission to edit.

props westi.
fixes #20201.



git-svn-id: http://core.svn.wordpress.org/trunk@24597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-09 02:22:57 +00:00
parent fe2ed20e34
commit b578f36b54

View File

@ -3199,6 +3199,7 @@ class wp_xmlrpc_server extends IXR_Server {
*/
function _getOptions($options) {
$data = array();
$can_manage = current_user_can( 'manage_options' );
foreach ( $options as $option ) {
if ( array_key_exists( $option, $this->blog_options ) ) {
$data[$option] = $this->blog_options[$option];
@ -3207,6 +3208,9 @@ class wp_xmlrpc_server extends IXR_Server {
$data[$option]['value'] = get_option( $data[$option]['option'] );
unset($data[$option]['option']);
}
if ( ! $can_manage )
$data[$option]['readonly'] = true;
}
}