Skip to:
Content

BuddyPress.org

Changeset 8135


Ignore:
Timestamp:
03/14/2014 01:12:13 AM (11 years ago)
Author:
boonebgorges
Message:

Remove unnecessary parameter sanitization from meta functions

WP's meta API functions already perform the necessary sanitization.

See #5399

Location:
trunk
Files:
4 edited

Legend:

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

    r8133 r8135  
    572572    global $wpdb, $bp;
    573573
    574     // Legacy - Return false if any of the above values are not set
    575     if ( ! is_numeric( $activity_id ) ) {
    576         return false;
    577     }
    578 
    579574    // Legacy - if no meta_key is passed, delete all for the item
    580575    if ( empty( $meta_key ) ) {
     
    616611 */
    617612function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true ) {
    618 
    619     // Make sure activity_id is valid
    620     if ( empty( $activity_id ) || ! is_numeric( $activity_id ) ) {
    621         return false;
    622     }
    623 
    624613    add_filter( 'query', 'bp_filter_metaid_column_name' );
    625614    $retval = get_metadata( 'activity', $activity_id, $meta_key, $single );
     
    647636 */
    648637function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_value = '' ) {
    649 
    650     // Legacy - Make sure activity_id is valid
    651     if ( ! is_numeric( $activity_id ) ) {
    652         return false;
    653     }
    654 
    655638    add_filter( 'query', 'bp_filter_metaid_column_name' );
    656639    $retval = update_metadata( 'activity', $activity_id, $meta_key, $meta_value, $prev_value );
  • trunk/bp-blogs/bp-blogs-functions.php

    r8134 r8135  
    849849    global $wpdb, $bp;
    850850
    851     // Legacy - return false if the $blog_id is empty
    852     if ( ! is_numeric( $blog_id ) ) {
    853         return false;
    854     }
    855 
    856851    // Legacy - if no meta_key is passed, delete all for the blog_id
    857852    if ( empty( $meta_key ) ) {
     
    864859    add_filter( 'query', 'bp_filter_metaid_column_name' );
    865860
     861    $retval = false;
    866862    foreach ( $keys as $key ) {
    867863        $retval = delete_metadata( 'blog', $blog_id, $key, $meta_value, $delete_all );
  • trunk/bp-groups/bp-groups-functions.php

    r8134 r8135  
    10331033    global $wpdb;
    10341034
    1035     // Legacy - return false if non-int group ID
    1036     if ( ! is_numeric( $group_id ) ) {
    1037         return false;
    1038     }
    1039 
    10401035    // Legacy - if no meta_key is passed, delete all for the item
    10411036    if ( empty( $meta_key ) ) {
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r8134 r8135  
    579579    global $wpdb;
    580580
    581     // Legacy - no empty object id
    582     if ( empty( $object_id ) ) {
    583         return false;
    584     }
    585 
    586     // Legacy - sanitize object type
     581    // Sanitize object type
    587582    if ( ! in_array( $object_type, array( 'group', 'field', 'data' ) ) ) {
    588583        return false;
     
    604599    add_filter( 'query', 'bp_xprofile_filter_meta_query' );
    605600
     601    $retval = false;
    606602    foreach ( $keys as $key ) {
    607603        $retval = delete_metadata( 'xprofile_' . $object_type, $object_id, $key, $meta_value, $delete_all );
     
    630626 */
    631627function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '', $single = true ) {
    632     // Legacy - sanitize object type
     628    // Sanitize object type
    633629    if ( ! in_array( $object_type, array( 'group', 'field', 'data' ) ) ) {
    634630        return false;
Note: See TracChangeset for help on using the changeset viewer.