Changeset 9707
- Timestamp:
- 04/06/2015 09:14:50 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r9702 r9707 745 745 if ( empty( $r['exact'] ) ) { 746 746 $spacepos = mb_strrpos( $truncate, ' ' ); 747 if ( isset( $spacepos )) {747 if ( false !== $spacepos ) { 748 748 if ( $r['html'] ) { 749 749 $bits = mb_substr( $truncate, $spacepos ); -
trunk/tests/phpunit/testcases/core/template/bpCreateExcerpt.php
r9523 r9707 41 41 ) ) ); 42 42 } 43 44 public function test_should_break_on_prior_word_boundary_when_exact_is_false() { 45 $text = 'aaaaa aaaaaa'; 46 $expected = 'aaaaa'; 47 $this->assertSame( $expected, bp_create_excerpt( $text, 7, array( 48 'exact' => false, 49 'ending' => '', 50 ) ) ); 51 } 52 53 /** 54 * @ticket BP6254 55 */ 56 public function test_should_trim_too_long_first_word_to_max_characters_even_when_exact_is_false() { 57 $text = 'aaaaaaaaaaa'; 58 $expected = 'aaa'; 59 $this->assertSame( $expected, bp_create_excerpt( $text, 3, array( 60 'exact' => false, 61 'ending' => '', 62 ) ) ); 63 } 43 64 }
Note: See TracChangeset
for help on using the changeset viewer.