Ticket #44416: 44416.2.diff
File 44416.2.diff, 10.2 KB (added by , 6 years ago) |
---|
-
.travis.yml
14 14 include: 15 15 - php: 7.1 16 16 env: WP_TRAVISCI=travis:js 17 - php: 7.3 17 18 - php: 7.2 18 19 - php: 7.1 19 20 - php: 7.0 … … 30 31 - php: nightly 31 32 allow_failures: 32 33 - php: nightly 34 - php: 7.3 33 35 before_install: 34 36 - | 35 37 if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then … … 63 65 # Install the specified version of PHPUnit depending on the PHP version: 64 66 if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then 65 67 case "$TRAVIS_PHP_VERSION" in 66 7. 2|7.1|7.0|nightly)68 7.3|7.2|7.1|7.0|nightly) 67 69 echo "Using PHPUnit 6.x" 68 70 composer global require "phpunit/phpunit:^6" 69 71 ;; -
src/wp-includes/class-wp-comment-query.php
633 633 $number = absint( $this->query_vars['number'] ); 634 634 $offset = absint( $this->query_vars['offset'] ); 635 635 $paged = absint( $this->query_vars['paged'] ); 636 $limits = ''; 636 637 637 638 if ( ! empty( $number ) ) { 638 639 if ( $offset ) { … … 817 818 $this->sql_clauses['where']['post_author__not_in'] = 'post_author NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post_author__not_in'] ) ) . ' )'; 818 819 } 819 820 820 $join = ''; 821 $join = ''; 822 $groupby = ''; 821 823 822 824 if ( $join_posts_table ) { 823 825 $join .= "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID"; -
src/wp-includes/class-wp-network-query.php
326 326 $orderby = "$wpdb->site.id $order"; 327 327 } 328 328 329 $number = absint( $this->query_vars['number'] ); 330 $offset = absint( $this->query_vars['offset'] ); 331 332 if ( ! empty( $number ) ) { 329 $number = absint( $this->query_vars['number'] ); 330 $offset = absint( $this->query_vars['offset'] ); 331 $limits = ''; 332 333 if ( ! empty( $number ) ) { 333 334 if ( $offset ) { 334 335 $limits = 'LIMIT ' . $offset . ',' . $number; 335 336 } else { … … 390 391 } 391 392 392 393 $join = ''; 394 395 $where = implode( ' AND ', $this->sql_clauses['where'] ); 396 397 $groupby = ''; 398 399 $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' ); 393 400 394 $where = implode( ' AND ', $this->sql_clauses['where'] );395 396 $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );397 398 401 /** 399 402 * Filters the network query clauses. 400 403 * -
src/wp-includes/class-wp-site-query.php
370 370 $orderby = "blog_id $order"; 371 371 } 372 372 373 $number = absint( $this->query_vars['number'] ); 374 $offset = absint( $this->query_vars['offset'] ); 375 376 if ( ! empty( $number ) ) { 373 $number = absint( $this->query_vars['number'] ); 374 $offset = absint( $this->query_vars['offset'] ); 375 $limits = ''; 376 377 if ( ! empty( $number ) ) { 377 378 if ( $offset ) { 378 379 $limits = 'LIMIT ' . $offset . ',' . $number; 379 380 } else { … … 522 523 } 523 524 524 525 $join = ''; 526 527 $where = implode( ' AND ', $this->sql_clauses['where'] ); 528 529 $groupby = ''; 530 531 $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' ); 525 532 526 $where = implode( ' AND ', $this->sql_clauses['where'] );527 528 $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );529 530 533 /** 531 534 * Filters the site query clauses. 532 535 * -
src/wp-includes/class-wp-xmlrpc-server.php
3517 3517 3518 3518 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 3519 3519 do_action( 'xmlrpc_call', 'wp.editComment' ); 3520 $comment = array( 3521 'comment_ID' => $comment_ID, 3522 ); 3520 3523 3521 3524 if ( isset($content_struct['status']) ) { 3522 3525 $statuses = get_comment_statuses(); … … 3524 3527 3525 3528 if ( ! in_array($content_struct['status'], $statuses) ) 3526 3529 return new IXR_Error( 401, __( 'Invalid comment status.' ) ); 3527 $comment_approved = $content_struct['status']; 3530 3531 $comment['comment_approved'] = $content_struct['status']; 3528 3532 } 3529 3533 3530 3534 // Do some timestamp voodoo 3531 3535 if ( !empty( $content_struct['date_created_gmt'] ) ) { 3532 3536 // We know this is supposed to be GMT, so we're going to slap that Z on there by force 3533 $dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z'; 3534 $comment_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); 3535 $comment_date_gmt = iso8601_to_datetime($dateCreated, 'GMT'); 3537 3538 $dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z'; 3539 $comment['comment_date'] = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) ); 3540 $comment['comment_date_gmt'] = iso8601_to_datetime( $dateCreated, 'GMT' ); 3536 3541 } 3537 3542 3538 if ( isset($content_struct['content']) ) 3539 $comment_content = $content_struct['content']; 3543 if ( isset($content_struct['content']) ) { 3544 $comment['comment_content'] = $content_struct['content']; 3545 } 3540 3546 3541 if ( isset($content_struct['author']) ) 3542 $comment_author = $content_struct['author']; 3547 if ( isset($content_struct['author']) ) { 3548 $comment['comment_author'] = $content_struct['author']; 3549 } 3543 3550 3544 if ( isset($content_struct['author_url']) ) 3545 $comment_author_url = $content_struct['author_url']; 3551 if ( isset($content_struct['author_url']) ) { 3552 $comment['comment_author_url'] = $content_struct['author_url']; 3553 } 3546 3554 3547 if ( isset($content_struct['author_email']) ) 3548 $comment_author_email = $content_struct['author_email']; 3555 if ( isset($content_struct['author_email']) ) { 3556 $comment['comment_author_email'] = $content_struct['author_email']; 3557 } 3549 3558 3550 // We've got all the data -- post it:3551 $comment = compact('comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url');3552 3553 3559 $result = wp_update_comment($comment); 3554 3560 if ( is_wp_error( $result ) ) 3555 3561 return new IXR_Error(500, $result->get_error_message()); … … 4989 4995 $post_name = $content_struct['wp_slug']; 4990 4996 4991 4997 // Only use a password if one was given. 4992 if ( isset($content_struct['wp_password']) ) 4998 if ( isset($content_struct['wp_password']) ) { 4993 4999 $post_password = $content_struct['wp_password']; 5000 } else { 5001 $post_password = ''; 5002 } 4994 5003 4995 5004 // Only set a post parent if one was provided. 4996 if ( isset($content_struct['wp_page_parent_id']) ) 5005 if ( isset($content_struct['wp_page_parent_id']) ) { 4997 5006 $post_parent = $content_struct['wp_page_parent_id']; 5007 } else { 5008 $post_parent = 0; 5009 } 4998 5010 4999 5011 // Only set the menu_order if it was provided. 5000 if ( isset($content_struct['wp_page_order']) ) 5012 if ( isset($content_struct['wp_page_order']) ) { 5001 5013 $menu_order = $content_struct['wp_page_order']; 5014 } else { 5015 $menu_order = 0; 5016 } 5002 5017 5003 5018 $post_author = $user->ID; 5004 5019 … … 5308 5323 5309 5324 $this->escape($postdata); 5310 5325 5311 $ID = $postdata['ID']; 5312 $post_content = $postdata['post_content']; 5313 $post_title = $postdata['post_title']; 5314 $post_excerpt = $postdata['post_excerpt']; 5315 $post_password = $postdata['post_password']; 5316 $post_parent = $postdata['post_parent']; 5317 $post_type = $postdata['post_type']; 5318 $menu_order = $postdata['menu_order']; 5326 $ID = $postdata['ID']; 5327 $post_content = $postdata['post_content']; 5328 $post_title = $postdata['post_title']; 5329 $post_excerpt = $postdata['post_excerpt']; 5330 $post_password = $postdata['post_password']; 5331 $post_parent = $postdata['post_parent']; 5332 $post_type = $postdata['post_type']; 5333 $menu_order = $postdata['menu_order']; 5334 $ping_status = $postdata['ping_status']; 5335 $comment_status = $postdata['comment_status']; 5319 5336 5320 5337 // Let WordPress manage slug if none was provided. 5321 5338 $post_name = $postdata['post_name']; -
src/wp-includes/comment.php
2977 2977 */ 2978 2978 function wp_handle_comment_submission( $comment_data ) { 2979 2979 2980 $comment_post_ID = $comment_parent = 0;2980 $comment_post_ID = $comment_parent = $user_ID = 0; 2981 2981 $comment_author = $comment_author_email = $comment_author_url = $comment_content = null; 2982 2982 2983 2983 if ( isset( $comment_data['comment_post_ID'] ) ) { -
src/wp-includes/post.php
3374 3374 $post_parent = 0; 3375 3375 } 3376 3376 3377 $new_postarr = array_merge( 3378 array( 3379 'ID' => $post_ID, 3380 ), 3381 compact( array_diff( array_keys( $defaults ), array( 'context', 'filter' ) ) ) 3382 ); 3383 3377 3384 /** 3378 3385 * Filters the post parent -- used to check for and prevent hierarchy loops. 3379 3386 * … … 3384 3391 * @param array $new_postarr Array of parsed post data. 3385 3392 * @param array $postarr Array of sanitized, but otherwise unmodified post data. 3386 3393 */ 3387 $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr );3394 $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr ); 3388 3395 3389 3396 /* 3390 3397 * If the post is being untrashed and it has a desired slug stored in post meta, -
tests/phpunit/tests/dependencies/scripts.php
819 819 * @covers wp_enqueue_code_editor() 820 820 */ 821 821 public function test_wp_enqueue_code_editor_when_generated_array_by_compact_will_be_passed() { 822 $file = ''; 822 823 $wp_enqueue_code_editor = wp_enqueue_code_editor( compact( 'file' ) ); 823 824 $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); 824 825