From f8b0fb06fe02c059b8fef13543161055a7c2a83e Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 5 Sep 2012 01:23:53 +0000 Subject: [PATCH] Validate $order in wp_get_object_terms(). props duck_. git-svn-id: https://develop.svn.wordpress.org/trunk@21758 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index f59aee7189..d5d54f4ca2 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1940,6 +1940,10 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { if ( !empty($orderby) ) $orderby = "ORDER BY $orderby"; + $order = strtoupper( $order ); + if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) + $order = 'ASC'; + $taxonomies = "'" . implode("', '", $taxonomies) . "'"; $object_ids = implode(', ', $object_ids);