Ticket #10377: 10377.6.diff
File 10377.6.diff, 1.4 KB (added by , 9 years ago) |
---|
-
src/wp-includes/comment.php
966 966 } elseif ( is_array( $col_length ) && isset( $col_length['length'] ) && intval( $col_length['length'] ) > 0 ) { 967 967 $max_length = (int) $col_length['length']; 968 968 } else { 969 $max_length = 255; 969 // Assume a TEXT column, 65535 - 10. 970 $max_length = 65525; 970 971 } 971 972 972 973 if ( ! empty( $col_length['type'] ) && 'byte' === $col_length['type'] ) { -
tests/phpunit/tests/comment.php
672 672 $this->assertSame( '111.111.1.1', $updated->comment_author_IP ); 673 673 $this->assertSame( 'SHIELD_AGENT', $updated->comment_agent ); 674 674 } 675 676 public function test_wp_get_comment_column_max_length() { 677 $columns = array( 678 'comment_author' => 245, 679 'comment_author_email' => 100, 680 'comment_author_url' => 200, 681 'comment_author_IP' => 100, 682 'comment_content' => 65525, 683 'comment_approved' => 20, 684 'comment_agent' => 255, 685 'comment_type' => 20, 686 ); 687 688 foreach ( $columns as $column => $expected ) { 689 $max_length = wp_get_comment_column_max_length( $column ); 690 $this->assertSame( $expected, $max_length ); 691 } 692 } 675 693 }