WordPress.org

Make WordPress Core

Ticket #44752: 44752.diff

File 44752.diff, 614 bytes (added by campusboy1987, 18 months ago)

With the previous version, I hurried, sorry. That's more correct in my opinion.

  • wp-includes/general-template.php

    diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
    index 33fcfbb..e7dedfa 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         }
    1730 
     1726        $r['limit'] = is_numeric( $r['limit'] ) ? absint( $r['limit'] ) : 0;
     1727        $r['limit'] = ' LIMIT ' . $r['limit'] : '';
     1728       
    17311729        $order = strtoupper( $r['order'] );
    17321730        if ( $order !== 'ASC' ) {
    17331731                $order = 'DESC';