Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/01/2011 09:36:22 PM (15 years ago)
Author:
djpaul
Message:

Escape xprofile base group name and fullname field name options on the settings screen. Fixes #2986

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-schema.php

    r3592 r3643  
    197197    $charset_collate = bp_core_set_charset();
    198198
    199     update_site_option( 'bp-xprofile-base-group-name', 'Base' );
    200     update_site_option( 'bp-xprofile-fullname-field-name', 'Name' );
     199    update_site_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) );
     200    update_site_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) );
    201201
    202202    $sql[] = "CREATE TABLE {$wpdb->base_prefix}bp_xprofile_groups (
     
    251251    dbDelta( $sql );
    252252
    253     /* Insert the default group and fields */
    254     $insert_sql = false;
     253    // Insert the default group and fields
     254    $insert_sql = array();
    255255
    256256    if ( !$wpdb->get_var( "SELECT id FROM {$wpdb->base_prefix}bp_xprofile_groups WHERE id = 1" ) )
    257         $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
     257        $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( " . $wpdb->prepare( '%s', stripslashes( get_site_option( 'bp-xprofile-base-group-name' ) ) ) . ", '', 0 );";
    258258
    259259    if ( !$wpdb->get_var( "SELECT id FROM {$wpdb->base_prefix}bp_xprofile_fields WHERE id = 1" ) )
    260         $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ) . "', '', 1, 0 );";
     260        $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( get_site_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );";
    261261
    262262    dbDelta( $insert_sql );
Note: See TracChangeset for help on using the changeset viewer.