WordPress.org

Make WordPress Core

Changeset 20740


Ignore:
Timestamp:
05/08/2012 08:01:47 PM (8 years ago)
Author:
ryan
Message:

Don't split the main query if there is no limit. This helps avoid extremely long query strings that could cause segfaults. Allow plugins to control splitting via split_the_query filter. see #20628

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r20491 r20740  
    26272627        }
    26282628
    2629         if ( $old_request == $this->request && "$wpdb->posts.*" == $fields ) {
     2629        $split_the_query = apply_filters( 'split_the_query', ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits) ), $this );
     2630
     2631        if ( $split_the_query ) {
    26302632            // First get the IDs and then fill in the objects
    26312633
Note: See TracChangeset for help on using the changeset viewer.