Validate $order in wp_get_object_terms(). props duck_.

git-svn-id: https://develop.svn.wordpress.org/trunk@21758 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-05 01:23:53 +00:00
parent 1e7a5ed329
commit f8b0fb06fe
1 changed files with 4 additions and 0 deletions

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