Ticket #3891: m_and_cat_problem_with_array_and_PHPGLOBAL.patch

File m_and_cat_problem_with_array_and_PHPGLOBAL.patch, 1.6 kB (added by g30rg3x, 2 years ago)

Temporary Solution

  • wp-includes/general-template.php

    old new  
    189189        } 
    190190 
    191191        // If there's a month 
    192         if ( !empty($m) ) { 
     192        if ( (!empty($m)) && (!is_array($m)) ) { 
    193193                $my_year = substr($m, 0, 4); 
    194194                $my_month = $wp_locale->get_month($m); 
    195195                $title = "$my_year $sep $my_month"; 
  • wp-includes/query.php

    old new  
    507507                                $this->is_date = true; 
    508508                        } 
    509509 
    510                         if (empty($qv['cat']) || ($qv['cat'] == '0')) { 
     510                        if (empty($qv['cat']) || ($qv['cat'] == '0') || (is_array($qv['cat']))) { 
    511511                                $this->is_category = false; 
    512512                        } else { 
    513513                                if (stristr($qv['cat'],'-')) { 
     
    704704                $wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"; 
    705705 
    706706                // If a month is specified in the querystring, load that month 
    707                 if ( (int) $q['m'] ) { 
     707                if ( ((int) $q['m']) && (!is_array($q['m'])) ) { 
    708708                        $q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']); 
    709709                        $where .= ' AND YEAR(post_date)=' . substr($q['m'], 0, 4); 
    710710                        if (strlen($q['m'])>5) 
     
    838838 
    839839                // Category stuff 
    840840 
    841                 if ((empty($q['cat'])) || ($q['cat'] == '0') || 
     841                if ((empty($q['cat'])) || ($q['cat'] == '0') || (is_array($q['cat'])) || 
    842842                                // Bypass cat checks if fetching specific posts 
    843843                                ( $this->is_single || $this->is_page )) { 
    844844                        $whichcat='';