Don't use variable variables in WP_Comment_Query::query().

See #27881.


git-svn-id: https://develop.svn.wordpress.org/trunk@28738 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-06-11 17:57:39 +00:00
parent f2b3e0c4e4
commit ce8cff84aa

View File

@ -443,8 +443,14 @@ class WP_Comment_Query {
* @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 ) );
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 ) {
$groupby = 'GROUP BY ' . $groupby;