Ticket #34879: 34879-2.patch
| File 34879-2.patch, 1.5 KB (added by , 10 years ago) |
|---|
-
tests/phpunit/tests/general/document-title.php
243 243 function _change_title_separator( $sep ) { 244 244 return '%%'; 245 245 } 246 247 /** 248 * @ticket 34879 249 */ 250 function test_wp_title_t_sep_typo() { 251 update_option( 'show_on_front', 'page' ); 252 253 $this->go_to( '/' ); 254 255 global $wp_query; 256 $wp_query->queried_object = $wp_query->post; 257 $wp_query->queried_object_id = (int) $wp_query->queried_object->ID; 258 259 $old_title = $wp_query->post->post_title; 260 $wp_query->post->post_title = 'test%WP_TITLE_SEP%title'; 261 262 $this->assertEquals( ' » test » title', wp_title( '»', false ) ); 263 264 $wp_query->post->post_title = $old_title; 265 update_option( 'show_on_front', 'posts' ); 266 } 246 267 } -
src/wp-includes/general-template.php
995 995 $search = get_query_var( 's' ); 996 996 $title = ''; 997 997 998 $t_sep = '%WP_TIT ILE_SEP%'; // Temporary separator, for accurate flipping, if necessary998 $t_sep = '%WP_TITLE_SEP%'; // Temporary separator, for accurate flipping, if necessary 999 999 1000 1000 // If there is a post 1001 1001 if ( is_single() || ( is_home() && ! is_front_page() ) || ( is_page() && ! is_front_page() ) ) {