Changeset 47808 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r47550 r47808 1132 1132 if ( '0' == $comment->comment_approved ) { 1133 1133 $comment_status = 'hold'; 1134 } elseif ( 'spam' == $comment->comment_approved ) {1134 } elseif ( 'spam' === $comment->comment_approved ) { 1135 1135 $comment_status = 'spam'; 1136 1136 } elseif ( '1' == $comment->comment_approved ) { … … 3380 3380 $cat_id = wp_insert_category( $new_category, true ); 3381 3381 if ( is_wp_error( $cat_id ) ) { 3382 if ( 'term_exists' == $cat_id->get_error_code() ) {3382 if ( 'term_exists' === $cat_id->get_error_code() ) { 3383 3383 return (int) $cat_id->get_error_data(); 3384 3384 } else { … … 3913 3913 3914 3914 if ( get_option( 'require_name_email' ) ) { 3915 if ( 6 > strlen( $comment['comment_author_email'] ) || ''== $comment['comment_author'] ) {3915 if ( strlen( $comment['comment_author_email'] < 6 ) || '' === $comment['comment_author'] ) { 3916 3916 return new IXR_Error( 403, __( 'Comment author name and email are required.' ) ); 3917 3917 } elseif ( ! is_email( $comment['comment_author_email'] ) ) { … … 5721 5721 5722 5722 $page_template = null; 5723 if ( ! empty( $content_struct['wp_page_template'] ) && 'page' == $post_type ) {5723 if ( ! empty( $content_struct['wp_page_template'] ) && 'page' === $post_type ) { 5724 5724 $page_template = $content_struct['wp_page_template']; 5725 5725 } … … 5848 5848 5849 5849 if ( 'publish' === $post_status || 'private' === $post_status ) { 5850 if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {5850 if ( 'page' === $post_type && ! current_user_can( 'publish_pages' ) ) { 5851 5851 return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this page.' ) ); 5852 5852 } elseif ( ! current_user_can( 'publish_posts' ) ) { … … 5992 5992 do_action( 'xmlrpc_call', 'metaWeblog.getPost' ); 5993 5993 5994 if ( '' != $postdata['post_date'] ) {5994 if ( '' !== $postdata['post_date'] ) { 5995 5995 $post_date = $this->_convert_date( $postdata['post_date'] ); 5996 5996 $post_date_gmt = $this->_convert_date_gmt( $postdata['post_date_gmt'], $postdata['post_date'] ); … … 6021 6021 $author = get_userdata( $postdata['post_author'] ); 6022 6022 6023 $allow_comments = ( 'open' == $postdata['comment_status'] ) ? 1 : 0;6024 $allow_pings = ( 'open' == $postdata['ping_status'] ) ? 1 : 0;6023 $allow_comments = ( 'open' === $postdata['comment_status'] ) ? 1 : 0; 6024 $allow_pings = ( 'open' === $postdata['ping_status'] ) ? 1 : 0; 6025 6025 6026 6026 // Consider future posts as published. … … 6173 6173 $author = get_userdata( $entry['post_author'] ); 6174 6174 6175 $allow_comments = ( 'open' == $entry['comment_status'] ) ? 1 : 0;6176 $allow_pings = ( 'open' == $entry['ping_status'] ) ? 1 : 0;6175 $allow_comments = ( 'open' === $entry['comment_status'] ) ? 1 : 0; 6176 $allow_pings = ( 'open' === $entry['ping_status'] ) ? 1 : 0; 6177 6177 6178 6178 // Consider future posts as published. … … 6682 6682 $trackback_pings = array(); 6683 6683 foreach ( $comments as $comment ) { 6684 if ( 'trackback' == $comment->comment_type ) {6684 if ( 'trackback' === $comment->comment_type ) { 6685 6685 $content = $comment->comment_content; 6686 6686 $title = substr( $content, 8, ( strpos( $content, '</strong>' ) - 8 ) ); … … 7029 7029 $pingbacks = array(); 7030 7030 foreach ( $comments as $comment ) { 7031 if ( 'pingback' == $comment->comment_type ) {7031 if ( 'pingback' === $comment->comment_type ) { 7032 7032 $pingbacks[] = $comment->comment_author_url; 7033 7033 }
Note: See TracChangeset
for help on using the changeset viewer.