Stop invalid SQL syntax by bailing from wp_get_object_terms() if $object_ids or $taxonomies is empty. Props batmoo. Fixes #19952.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2012-02-21 20:20:50 +00:00
parent 5e653b76ed
commit 8ac3015ccf
1 changed files with 4 additions and 1 deletions

View File

@ -1862,11 +1862,14 @@ function wp_delete_category( $cat_ID ) {
* @param int|array $object_ids The ID(s) of the object(s) to retrieve.
* @param string|array $taxonomies The taxonomies to retrieve terms from.
* @param array|string $args Change what is returned
* @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if $taxonomy does not exist.
* @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if any of the $taxonomies don't exist.
*/
function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
global $wpdb;
if ( empty( $object_ids ) || empty( $taxonomies ) )
return array();
if ( !is_array($taxonomies) )
$taxonomies = array($taxonomies);