WordPress.org

Make WordPress Core

Changeset 19975


Ignore:
Timestamp:
02/21/12 20:20:50 (4 years ago)
Author:
duck_
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r19930 r19975  
    18631863 * @param string|array $taxonomies The taxonomies to retrieve terms from. 
    18641864 * @param array|string $args Change what is returned 
    1865  * @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if $taxonomy does not exist. 
     1865 * @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. 
    18661866 */ 
    18671867function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { 
    18681868    global $wpdb; 
     1869 
     1870    if ( empty( $object_ids ) || empty( $taxonomies ) ) 
     1871        return array(); 
    18691872 
    18701873    if ( !is_array($taxonomies) ) 
Note: See TracChangeset for help on using the changeset viewer.