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-groups/bp-groups-functions.php

    r7442 r7469  
    10561056    $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
    10571057
    1058     if ( is_string( $meta_value ) )
    1059         $meta_value = stripslashes( esc_sql( $meta_value ) );
     1058    if ( is_string( $meta_value ) ) {
     1059        $meta_value = stripslashes( $meta_value );
     1060    }
    10601061
    10611062    $meta_value = maybe_serialize( $meta_value );
Note: See TracChangeset for help on using the changeset viewer.