mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-08 11:10:03 +00:00
Fix gallery shortcode orderby param for all SQL setups. Sanitize orderby. fixes #6476 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -460,6 +460,10 @@ function get_posts($args) {
|
||||
if (!empty($exclusions))
|
||||
$exclusions .= ')';
|
||||
|
||||
// orderby
|
||||
if ( preg_match( '/.+ +(ASC|DESC)/i', $orderby ) )
|
||||
$order = ''; // orderby has its own order, so we'll use that
|
||||
|
||||
$query = "SELECT DISTINCT * FROM $wpdb->posts ";
|
||||
$query .= empty( $category ) ? '' : ", $wpdb->term_relationships, $wpdb->term_taxonomy ";
|
||||
$query .= empty( $meta_key ) ? '' : ", $wpdb->postmeta ";
|
||||
|
||||
Reference in New Issue
Block a user