Query: Make sure `$climits` variable in `WP_Query::get_posts()` is always defined to avoid a PHP notice.

Props juiiee8487, agengineering.
Fixes #47638.
Built from https://develop.svn.wordpress.org/trunk@45591


git-svn-id: http://core.svn.wordpress.org/trunk@45402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-07-03 01:14:57 +00:00
parent 4803fc405e
commit 268c64913e
2 changed files with 3 additions and 1 deletions

View File

@ -2629,8 +2629,10 @@ class WP_Query {
*/
$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );
}
$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
$climits = ( ! empty( $climits ) ) ? $climits : '';
$comments = (array) $wpdb->get_results( "SELECT $distinct {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits" );
// Convert to WP_Comment

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45590';
$wp_version = '5.3-alpha-45591';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.