Making WordPress.org

Changeset 10541


Ignore:
Timestamp:
12/21/2020 05:34:54 AM (6 years ago)
Author:
dd32
Message:

Theme Directory: API: Negative numbers are not a valid value for the per_page query parameter.

Ignore it when 0 or -1 is passed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r10296 r10541  
    544544                }
    545545                if ( isset( $this->request->per_page ) ) {
     546                        // Maximum of 999 themes per page, and a minimum of 1.
    546547                        $this->query['posts_per_page'] = min( (int) $this->request->per_page, 999 );
     548                        if ( $this->query['posts_per_page'] < 1 ) {
     549                                unset( $this->query['posts_per_page'] );
     550                        }
    547551                }
    548552
Note: See TracChangeset for help on using the changeset viewer.