Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/12/2013 08:45:55 PM (10 years ago)
Author:
johnjamesjacoby
Message:

In bbp_check_for_duplicate(), run wp_unslash() or stripslashes_deep() on the entire $r array. Remove unslashing on results of get_meta_sql() to allow any previously slashed values to remain slashed. See #2185.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/common/functions.php

    r4846 r4847  
    686686    }
    687687
    688     // Unslash strings to pass through $wpdb->prepare()
     688    // Unslash $r to pass through $wpdb->prepare()
    689689    //
    690690    // @see: http://bbpress.trac.wordpress.org/ticket/2185/
    691691    // @see: http://core.trac.wordpress.org/changeset/23973/
    692     if ( function_exists( 'wp_unslash' ) ) { // added in WordPress 3.6
    693         $r['post_type']    = wp_unslash( $r['post_type']    );
    694         $r['post_status']  = wp_unslash( $r['post_status']  );
    695         $r['post_content'] = wp_unslash( $r['post_content'] );
    696         $join              = wp_unslash( $join              );
    697         $where             = wp_unslash( $where             );
    698     } else {
    699         $r['post_type']    = stripslashes_deep( $r['post_type']    );
    700         $r['post_status']  = stripslashes_deep( $r['post_status']  );
    701         $r['post_content'] = stripslashes_deep( $r['post_content'] );
    702         $join              = stripslashes_deep( $join              );
    703         $where             = stripslashes_deep( $where             );
    704     }
     692    $r = function_exists( 'wp_unslash' ) ? wp_unslash( $r ) : stripslashes_deep( $r );
    705693
    706694    // Prepare duplicate check query
Note: See TracChangeset for help on using the changeset viewer.