Make WordPress Core


Ignore:
Timestamp:
07/05/2005 08:47:22 PM (21 years ago)
Author:
ryan
Message:

Use wpdb->escape instead of addslashes to prepare DB bound data.

File:
1 edited

Legend:

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

    r2697 r2699  
    844844                        if ( $headers = wp_get_http_headers( $url) ) {
    845845                                $len  = (int) $headers['content-length'];
    846                                 $type = addslashes( $headers['content-type'] );
     846                                $type = $wpdb->escape( $headers['content-type'] );
    847847                                $allowed_types = array( 'video', 'audio' );
    848848                                if( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) {
    … …  
    18831883
    18841884function add_magic_quotes($array) {
     1885        global $wpdb;
     1886
    18851887        foreach ($array as $k => $v) {
    18861888                if (is_array($v)) {
    18871889                        $array[$k] = add_magic_quotes($v);
    18881890                } else {
    1889                         $array[$k] = addslashes($v);
     1891                        $array[$k] = $wpdb->escape($v);
    18901892                }
    18911893        }
Note: See TracChangeset for help on using the changeset viewer.