mirror of
git://develop.git.wordpress.org/
synced 2025-03-24 22:10:02 +01:00
Coding Standards: Use strict comparison in wp_xmlrpc_server::mw_editPost()
.
Follow-up to [5281], [19914], [31983]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59723 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a2b20266ea
commit
1a8297e40b
@ -5790,7 +5790,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
}
|
||||
|
||||
// Thwart attempt to change the post type.
|
||||
if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] != $postdata['post_type'] ) ) {
|
||||
if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] !== $postdata['post_type'] ) ) {
|
||||
return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
|
||||
}
|
||||
|
||||
@ -5843,10 +5843,10 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$post_author = $postdata['post_author'];
|
||||
|
||||
// If an author id was provided then use it instead.
|
||||
// If an author ID was provided then use it instead.
|
||||
if ( isset( $content_struct['wp_author_id'] ) ) {
|
||||
// Check permissions if attempting to switch author to or from another user.
|
||||
if ( $user->ID != $content_struct['wp_author_id'] || $user->ID != $post_author ) {
|
||||
if ( $user->ID !== (int) $content_struct['wp_author_id'] || $user->ID !== (int) $post_author ) {
|
||||
switch ( $post_type ) {
|
||||
case 'post':
|
||||
if ( ! current_user_can( 'edit_others_posts' ) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user