Make WordPress Core

Changeset 21161


Ignore:
Timestamp:
06/28/2012 07:57:31 PM (12 years ago)
Author:
nacin
Message:

Handle localized floats in $wpdb->prepare(). props kurtpayne. fixes #19861.

File:
1 edited

Legend:

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

    r20483 r21161  
    851851     */
    852852    function escape_by_ref( &$string ) {
    853         $string = $this->_real_escape( $string );
     853        if ( ! is_float( $string ) )
     854            $string = $this->_real_escape( $string );
    854855    }
    855856
     
    902903        $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
    903904        $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
     905        $query = str_replace( '%f' , '%F', $query ); // Force floats to be locale unaware       
    904906        $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
    905907        array_walk( $args, array( &$this, 'escape_by_ref' ) );
Note: See TracChangeset for help on using the changeset viewer.