WordPress.org

Make WordPress Core

Ticket #14766: wp-includes-meta-filters-revised.patch

File wp-includes-meta-filters-revised.patch, 655 bytes (added by sc0ttkclark, 3 years ago)

Removed use of maybe_unserialized - it's been conveyed that this should be handled by the plugin itself

  • wp-includes/meta.php

     
    245245 
    246246        $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single ); 
    247247        if ( null !== $check ) { 
    248                 if ( !is_array( $check ) ) 
    249                         return $check; 
    250                 elseif ( $single ) 
    251                         return maybe_unserialize( $check[0] ); 
     248                if ( $single && is_array( $check ) ) 
     249                        return $check[0]; 
    252250                else 
    253                         return array_map( 'maybe_unserialize', $check ); 
     251                        return $check; 
    254252        } 
    255253 
    256254        $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');