mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-20 19:56:49 +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. Built from https://develop.svn.wordpress.org/trunk@59723 git-svn-id: http://core.svn.wordpress.org/trunk@59065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c8f766843f
commit
5d4148c10d
|
|
@ -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' ) ) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59722';
|
||||
$wp_version = '6.8-alpha-59723';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user