Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/23/2013 06:47:16 PM (11 years ago)
Author:
boonebgorges
Message:

Sanitize more gently in component *_update_meta() functions

Previous sanitization techniques resulted in double-sanitization. Recent
changes in how WP's SQL sanitization routines work have surfaced this problem,
in particular as regards line breaks. By removing the extraneous call to
esc_sql(), we ensure that line breaks are preserved, and sanitization is left
to $wpdb->prepare().

Change applied in update_meta() functions through bp-groups, bp-activity, and
bp-xprofile. Also adds corresponding unit tests.

Fixes #5180

File:
1 edited

Legend:

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

    r7448 r7469  
    681681
    682682    // Sanitize value
    683     if ( is_string( $meta_value ) )
    684         $meta_value = stripslashes( esc_sql( $meta_value ) );
     683    if ( is_string( $meta_value ) ) {
     684        $meta_value = stripslashes( $meta_value );
     685    }
    685686
    686687    // Maybe, just maybe... serialize
Note: See TracChangeset for help on using the changeset viewer.