Make WordPress Core

Ticket #44752: 44752-2.diff

File 44752-2.diff, 605 bytes (added by campusboy1987, 6 years ago)

the condition is corrected

  • wp-includes/general-template.php

    diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
    index 33fcfbb..12e07f7 100644
    a b function wp_get_archives( $args = '' ) { 
    17231723                $r['type'] = 'monthly';
    17241724        }
    17251725
    1726         if ( ! empty( $r['limit'] ) ) {
    1727                 $r['limit'] = absint( $r['limit'] );
    1728                 $r['limit'] = ' LIMIT ' . $r['limit'];
    1729         }
     1726        $r['limit'] = is_numeric( $r['limit'] ) ? absint( $r['limit'] ) : 0;
     1727        $r['limit'] = $r['limit'] ? ' LIMIT ' . $r['limit'] : '';
    17301728
    17311729        $order = strtoupper( $r['order'] );
    17321730        if ( $order !== 'ASC' ) {