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: https://develop.svn.wordpress.org/trunk@19975 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jon Cave 2012-02-21 20:20:50 +00:00
parent e60c17736d
commit 5fcb582c25
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);