WPDB: When checking that text isn't too long to insert into a column, LONGTEXT
columns could fail, as their length is longer than PHP_INT_MAX
. Treating their length as a float
instead of an int
fixes this.
See #32165. git-svn-id: https://develop.svn.wordpress.org/trunk@33276 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bd6c09724e
commit
c160106af1
@ -2717,9 +2717,9 @@ class wpdb {
|
||||
// We're going to need to truncate by characters or bytes, depending on the length value we have.
|
||||
if ( 'byte' === $value['length']['type'] ) {
|
||||
// Split the CONVERT() calls by charset, so we can make sure the connection is right
|
||||
$queries[ $value['charset'] ][ $col ] = $this->prepare( "CONVERT( LEFT( CONVERT( %s USING binary ), %d ) USING {$value['charset']} )", $value['value'], $value['length']['length'] );
|
||||
$queries[ $value['charset'] ][ $col ] = $this->prepare( "CONVERT( LEFT( CONVERT( %s USING binary ), %.0f ) USING {$value['charset']} )", $value['value'], $value['length']['length'] );
|
||||
} else {
|
||||
$queries[ $value['charset'] ][ $col ] = $this->prepare( "LEFT( CONVERT( %s USING {$value['charset']} ), %d )", $value['value'], $value['length']['length'] );
|
||||
$queries[ $value['charset'] ][ $col ] = $this->prepare( "LEFT( CONVERT( %s USING {$value['charset']} ), %.0f )", $value['value'], $value['length']['length'] );
|
||||
}
|
||||
|
||||
unset( $data[ $col ]['db'] );
|
||||
|
Loading…
Reference in New Issue
Block a user