Ticket #11439: 11439.diff
| File 11439.diff, 2.5 KB (added by , 17 years ago) |
|---|
-
wp-includes/post-template.php
392 392 $classes[] = 'error404'; 393 393 394 394 if ( is_single() ) { 395 $wp_query->post = $wp_query->posts[0]; 396 setup_postdata($wp_query->post); 397 398 $postID = $wp_query->post->ID; 395 $postID = $wp_query->get_queried_object_id(); 396 399 397 $classes[] = 'single postid-' . $postID; 400 398 401 399 if ( is_attachment() ) { 402 $mime_type = get_post_mime_type( );400 $mime_type = get_post_mime_type($postID); 403 401 $mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' ); 404 402 $classes[] = 'attachmentid-' . $postID; 405 403 $classes[] = 'attachment-' . str_replace($mime_prefix, '', $mime_type); … … 421 419 } elseif ( is_page() ) { 422 420 $classes[] = 'page'; 423 421 424 $wp_query->post = $wp_query->posts[0]; 425 setup_postdata($wp_query->post); 422 $pageID = $wp_query->get_queried_object_id(); 426 423 427 $p ageID = $wp_query->post->ID;424 $post = get_page($pageID); 428 425 429 426 $classes[] = 'page-id-' . $pageID; 430 427 431 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) )428 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status == 'publish' LIMIT 1", $pageID) ) ) 432 429 $classes[] = 'page-parent'; 433 430 434 if ( $ wp_query->post->post_parent ) {431 if ( $post->post_parent ) { 435 432 $classes[] = 'page-child'; 436 $classes[] = 'parent-pageid-' . $ wp_query->post->post_parent;433 $classes[] = 'parent-pageid-' . $post->post_parent; 437 434 } 438 435 if ( is_page_template() ) { 439 436 $classes[] = 'page-template'; … … 479 476 $classes = array_merge($classes, $class); 480 477 } 481 478 482 $classes = array_map(' esc_attr', $classes);479 $classes = array_map('sanitize_html_class', $classes); 483 480 484 481 return apply_filters('body_class', $classes, $class); 485 482 } -
wp-includes/formatting.php
839 839 * @param string $fallback The value to return if the sanitization end's up as an empty string. 840 840 * @return string The sanitized value 841 841 */ 842 function sanitize_html_class($class, $fallback ){842 function sanitize_html_class($class, $fallback = ''){ 843 843 //Strip out any % encoded octets 844 844 $sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class); 845 845
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)