Changeset 49303
- Timestamp:
- 10/24/2020 10:44:38 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r49271 r49303 3877 3877 } 3878 3878 3879 if ( empty( $content_struct['content'] ) ) {3880 return new IXR_Error( 403, __( 'Comment is required.' ) );3881 }3882 3883 3879 $comment = array( 3884 3880 'comment_post_ID' => $post_id, 3885 'comment_content' => $content_struct['content'],3881 'comment_content' => , 3886 3882 ); 3887 3883 … … 3923 3919 3924 3920 $comment['comment_parent'] = isset( $content_struct['comment_parent'] ) ? absint( $content_struct['comment_parent'] ) : 0; 3921 3922 3923 3924 3925 3926 3927 3925 3928 3926 3929 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r49299 r49303 588 588 $prepared_comment['comment_type'] = 'comment'; 589 589 590 /*591 * Do not allow a comment to be created with missing or empty592 * comment_content. See wp_handle_comment_submission().593 */ 594 if ( empty( $prepared_comment['comment_content']) ) {590 591 592 593 594 if ( ) ) { 595 595 return new WP_Error( 596 596 'rest_comment_content_invalid', … … 1281 1281 */ 1282 1282 if ( isset( $request['content'] ) && is_string( $request['content'] ) ) { 1283 $prepared_comment['comment_content'] = $request['content'];1283 $prepared_comment['comment_content'] = ; 1284 1284 } elseif ( isset( $request['content']['raw'] ) && is_string( $request['content']['raw'] ) ) { 1285 $prepared_comment['comment_content'] = $request['content']['raw'];1285 $prepared_comment['comment_content'] = ; 1286 1286 } 1287 1287 … … 1867 1867 return $email; 1868 1868 } 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1869 1904 } -
trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php
r49299 r49303 1399 1399 } 1400 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1401 1471 public function test_create_item_invalid_date() { 1402 1472 wp_set_current_user( self::$admin_id ); -
trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php
r49271 r49303 51 51 } 52 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 53 112 function test_new_comment_post_closed() { 54 113 $post = self::factory()->post->create_and_get(
Note: See TracChangeset
for help on using the changeset viewer.