Make WordPress Core


Ignore:
Timestamp:
03/01/2013 05:14:09 PM (12 years ago)
Author:
ryan
Message:

Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/upgrade.php

    r23554 r23567  
    133133
    134134        if ( empty($first_post) )
    135             $first_post = stripslashes( __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ) );
     135            $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' );
    136136
    137137        $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
     
    637637    foreach ( $users as $user ) :
    638638        if ( !empty( $user->user_firstname ) )
    639             update_user_meta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) );
     639            update_user_meta( $user->ID, 'first_name', wp_slash($user->user_firstname) );
    640640        if ( !empty( $user->user_lastname ) )
    641             update_user_meta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) );
     641            update_user_meta( $user->ID, 'last_name', wp_slash($user->user_lastname) );
    642642        if ( !empty( $user->user_nickname ) )
    643             update_user_meta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) );
     643            update_user_meta( $user->ID, 'nickname', wp_slash($user->user_nickname) );
    644644        if ( !empty( $user->user_level ) )
    645645            update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );
    646646        if ( !empty( $user->user_icq ) )
    647             update_user_meta( $user->ID, 'icq', $wpdb->escape($user->user_icq) );
     647            update_user_meta( $user->ID, 'icq', wp_slash($user->user_icq) );
    648648        if ( !empty( $user->user_aim ) )
    649             update_user_meta( $user->ID, 'aim', $wpdb->escape($user->user_aim) );
     649            update_user_meta( $user->ID, 'aim', wp_slash($user->user_aim) );
    650650        if ( !empty( $user->user_msn ) )
    651             update_user_meta( $user->ID, 'msn', $wpdb->escape($user->user_msn) );
     651            update_user_meta( $user->ID, 'msn', wp_slash($user->user_msn) );
    652652        if ( !empty( $user->user_yim ) )
    653             update_user_meta( $user->ID, 'yim', $wpdb->escape($user->user_icq) );
     653            update_user_meta( $user->ID, 'yim', wp_slash($user->user_icq) );
    654654        if ( !empty( $user->user_description ) )
    655             update_user_meta( $user->ID, 'description', $wpdb->escape($user->user_description) );
     655            update_user_meta( $user->ID, 'description', wp_slash($user->user_description) );
    656656
    657657        if ( isset( $user->user_idmode ) ):
     
    855855            $cat_id = (int) $category->cat_id;
    856856            $term_id = 0;
    857             $name = $wpdb->escape($category->cat_name);
     857            $name = wp_slash($category->cat_name);
    858858            $slug = sanitize_title($name);
    859859            $term_group = 0;
Note: See TracChangeset for help on using the changeset viewer.