Changeset 35959
- Timestamp:
- 12/16/2015 08:03:38 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r35856 r35959 119 119 function before_last_bar( $string ) { 120 120 $last_bar = strrpos( $string, '|' ); 121 if ( false === $last_bar ) 121 if ( false === $last_bar ) { 122 122 return $string; 123 else123 } else { 124 124 return substr( $string, 0, $last_bar ); 125 } 125 126 } 126 127 -
trunk/tests/phpunit/tests/l10n.php
r30521 r35959 17 17 $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) ); 18 18 } 19 20 /** 21 * @ticket 35073 22 */ 23 function test_before_last_bar() { 24 $this->assertEquals( 'no-bar-at-all', before_last_bar( 'no-bar-at-all' ) ); 25 $this->assertEquals( 'before-last-bar', before_last_bar( 'before-last-bar|after-bar' ) ); 26 $this->assertEquals( 'first-before-bar|second-before-bar', before_last_bar( 'first-before-bar|second-before-bar|after-last-bar' ) ); 27 } 28 19 29 }
Note: See TracChangeset
for help on using the changeset viewer.