Ticket #3148: patch.diff

File patch.diff, 3.4 KB (added by alexkingorg, 5 years ago)

patch

  • wp-includes/category.php

     
    2020                parse_str($args, $r); 
    2121 
    2222        $defaults = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 
    23                 'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, $exclude => '', $include => '', 
     23                'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 
    2424                'number' => ''); 
    2525        $r = array_merge($defaults, $r); 
    2626        if ( 'count' == $r['orderby'] ) 
  • wp-includes/post.php

     
    9999                } 
    100100        } 
    101101 
    102         if ( defined(WP_IMPORTING) ) 
     102        if ( defined('WP_IMPORTING') ) 
    103103                unset($post_cache); 
    104104 
    105105        if ( $output == OBJECT ) { 
     
    923923                wp_cache_add($page->ID, $page, 'pages'); 
    924924                $_page = $page; 
    925925        } else { 
    926                 if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) { 
     926                if ( isset($GLOBALS['page']->ID) && ($page == $GLOBALS['page']->ID) ) { 
    927927                        $_page = & $GLOBALS['page']; 
    928928                        wp_cache_add($_page->ID, $_page, 'pages'); 
    929                 } elseif ( $_page = $GLOBALS['post_cache'][$page] ) { 
     929                } elseif ( isset($_page) && $_page == $GLOBALS['post_cache'][$page] ) { 
    930930                        return get_post($page, $output); 
    931                 } elseif ( $_page = wp_cache_get($page, 'pages') ) { 
     931                } elseif ( isset($_page) && $_page == wp_cache_get($page, 'pages') ) { 
    932932                        // Got it. 
    933933                } else { 
    934934                        $query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1"; 
  • wp-includes/classes.php

     
    388388                        // If flat, start and end the element and skip the level checks. 
    389389                        if ( $flat) { 
    390390                                // Start the element. 
    391                                 if ( $element->$id_field != 0 ) { 
     391                                if ( isset($element->$id_field) && $element->$id_field != 0 ) { 
    392392                                        $cb_args = array_merge( array($output, $element, $depth - 1), $args); 
    393393                                        $output = call_user_func_array(array(&$this, 'start_el'), $cb_args); 
    394394                                } 
    395395         
    396396                                // End the element. 
    397                                 if ( $element->$id_field != 0 ) { 
     397                                if ( isset($element->$id_field) && $element->$id_field != 0 ) { 
    398398                                        $cb_args = array_merge( array($output, $element, $depth - 1), $args); 
    399399                                        $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); 
    400400                                } 
     
    583583                                $link .= ')'; 
    584584                } 
    585585         
    586                 if ( $show_count ) 
     586                if ( isset($show_count) && $show_count ) 
    587587                        $link .= ' ('.intval($category->category_count).')'; 
    588588         
    589                 if ( $show_date ) { 
     589                if ( isset($show_date) && $show_date ) { 
    590590                        $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); 
    591591                } 
    592592         
  • wp-includes/category-template.php

     
    219219                'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '', 
    220220                'hierarchical' => true, 'title_li' => __('Categories')); 
    221221        $r = array_merge($defaults, $r); 
    222         $r['include_last_update_time'] = $r['show_date']; 
     222        if ( isset($r['show_date']) ) 
     223                $r['include_last_update_time'] = $r['show_date']; 
    223224        extract($r); 
    224225 
    225226        $categories = get_categories($r);