Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/14/2014 12:15:41 AM (10 years ago)
Author:
boonebgorges
Message:

Don't trim whitespace from $meta_value param in _delete_meta() functions

The $meta_value parameter of BP's delete_meta() functions allows developers to
limit deletion to rows that match both the $meta_key *and* the specified
$meta_value. However, most of BP's delete_meta() functions have always had a
quirk whereby the $meta_value was run through trim() before matching against
the values in the database. This had the unacceptable side effect that passing
a $meta_value of ' foo ' would delete rows with the value 'foo', but *not*
the value ' foo '!

This changeset reverses the behavior, and modifies the relevant unit tests.

See #5399

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r8129 r8130  
    601601    }
    602602
    603     // Legacy - trim meta_value
    604     $meta_value = trim( $meta_value );
    605 
    606603    add_filter( 'query', 'bp_filter_metaid_column_name' );
    607604    add_filter( 'query', 'bp_xprofile_filter_meta_query' );
Note: See TracChangeset for help on using the changeset viewer.