Don't use variable variables in WP_Query::get_posts().

See #27881.


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

View File

@ -3082,9 +3082,13 @@ class WP_Query {
*/
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
foreach ( $pieces as $piece ) {
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
}
$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
$distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
}
/**
@ -3201,8 +3205,14 @@ class WP_Query {
* @param WP_Query &$this The WP_Query instance (passed by reference).
*/
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
foreach ( $pieces as $piece )
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
$distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
}
if ( ! empty($groupby) )