Make WordPress Core

Ticket #24884: 24884.patch

File 24884.patch, 969 bytes (added by Viper007Bond, 10 years ago)
  • wp-includes/query.php

     
    14451445                $qv['monthnum'] = absint($qv['monthnum']);
    14461446                $qv['day'] = absint($qv['day']);
    14471447                $qv['w'] = absint($qv['w']);
    1448                 $qv['m'] = absint($qv['m']);
     1448                $qv['m'] = preg_replace( '|[^0-9]|', '', $qv['m'] );
    14491449                $qv['paged'] = absint($qv['paged']);
    14501450                $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
    14511451                $qv['pagename'] = trim( $qv['pagename'] );
     
    20472047
    20482048                // If a month is specified in the querystring, load that month
    20492049                if ( $q['m'] ) {
    2050                         $q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']);
    20512050                        $where .= " AND YEAR($wpdb->posts.post_date)=" . substr($q['m'], 0, 4);
    20522051                        if ( strlen($q['m']) > 5 )
    20532052                                $where .= " AND MONTH($wpdb->posts.post_date)=" . substr($q['m'], 4, 2);