Don't use variable variables in `WP_Comment_Query::query()`.
See #27881. Built from https://develop.svn.wordpress.org/trunk@28738 git-svn-id: http://core.svn.wordpress.org/trunk@28552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c1e7c2d1de
commit
e5e8a83cf4
|
@ -443,8 +443,14 @@ class WP_Comment_Query {
|
||||||
* @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference.
|
* @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference.
|
||||||
*/
|
*/
|
||||||
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
|
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
|
||||||
foreach ( $pieces as $piece )
|
|
||||||
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
|
$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
|
||||||
|
$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
|
||||||
|
$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
|
||||||
|
$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
|
||||||
|
$order = isset( $clauses[ 'order' ] ) ? $clauses[ 'order' ] : '';
|
||||||
|
$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
|
||||||
|
$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
|
||||||
|
|
||||||
if ( $groupby ) {
|
if ( $groupby ) {
|
||||||
$groupby = 'GROUP BY ' . $groupby;
|
$groupby = 'GROUP BY ' . $groupby;
|
||||||
|
|
Loading…
Reference in New Issue