Make WordPress Core

Ticket #19861: 19861.5.patch

File 19861.5.patch, 796 bytes (added by SergeyBiryukov, 12 years ago)
  • wp-includes/wp-db.php

     
    902902                        $args = $args[0];
    903903                $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
    904904                $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
    905                 $query = str_replace( '%f' , '%F', $query ); // Force floats to be locale unaware               
     905                $query = preg_replace( '|(?<!%)%f|' , '%F', $query ); // force floats to be locale unaware
    906906                $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
    907907                array_walk( $args, array( &$this, 'escape_by_ref' ) );
    908908                return @vsprintf( $query, $args );