Make WordPress Core


Ignore:
Timestamp:
09/27/2009 05:33:56 AM (17 years ago)
Author:
markjaquith
Message:

esc_sql() for wp-includes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r11971 r11978  
    498498    wp_protect_special_option( $option_name );
    499499
    500     $safe_option_name = $wpdb->escape( $option_name );
     500    $safe_option_name = esc_sql( $option_name );
    501501    $newvalue = sanitize_option( $option_name, $newvalue );
    502502
     
    572572
    573573    wp_protect_special_option( $name );
    574     $safe_name = $wpdb->escape( $name );
     574    $safe_name = esc_sql( $name );
    575575    $value = sanitize_option( $name, $value );
    576576
     
    655655        return wp_cache_delete($transient, 'transient');
    656656    } else {
    657         $transient = '_transient_' . $wpdb->escape($transient);
     657        $transient = '_transient_' . esc_sql($transient);
    658658        return delete_option($transient);
    659659    }
     
    683683        $value = wp_cache_get($transient, 'transient');
    684684    } else {
    685         $transient_option = '_transient_' . $wpdb->escape($transient);
     685        $transient_option = '_transient_' . esc_sql($transient);
    686686        // If option is not in alloptions, it is not autoloaded and thus has a timeout
    687687        $alloptions = wp_load_alloptions();
    688688        if ( !isset( $alloptions[$transient_option] ) ) {
    689             $transient_timeout = '_transient_timeout_' . $wpdb->escape($transient);
     689            $transient_timeout = '_transient_timeout_' . esc_sql($transient);
    690690            if ( get_option($transient_timeout) < time() ) {
    691691                delete_option($transient_option);
     
    724724        $transient_timeout = '_transient_timeout_' . $transient;
    725725        $transient = '_transient_' . $transient;
    726         $safe_transient = $wpdb->escape($transient);
     726        $safe_transient = esc_sql($transient);
    727727        if ( false === get_option( $safe_transient ) ) {
    728728            $autoload = 'yes';
     
    14131413            $array[$k] = add_magic_quotes( $v );
    14141414        } else {
    1415             $array[$k] = $wpdb->escape( $v );
     1415            $array[$k] = esc_sql( $v );
    14161416        }
    14171417    }
Note: See TracChangeset for help on using the changeset viewer.