Validate $order in wp_get_object_terms(). props duck_.

git-svn-id: http://core.svn.wordpress.org/trunk@21758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-05 01:23:53 +00:00
parent a9dc9dc829
commit 5a9193d6c9

View File

@ -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);