In [32299], we should be using `mb_strlen()` for our string size checks.

git-svn-id: https://develop.svn.wordpress.org/trunk@32306 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2015-04-27 14:41:48 +00:00
parent 45b0abbef1
commit 0152b8f49b
2 changed files with 8 additions and 1 deletions

View File

@ -2064,7 +2064,7 @@ class wpdb {
}
}
if ( false !== $value['length'] && strlen( $value['value'] ) > $value['length'] ) {
if ( false !== $value['length'] && mb_strlen( $value['value'] ) > $value['length'] ) {
return false;
}

View File

@ -137,5 +137,12 @@ class Tests_Comment extends WP_UnitTestCase {
$id = wp_new_comment( $data );
$this->assertFalse( $id );
// Cleanup.
if ( isset( $remote_addr ) ) {
$_SERVER['REMOTE_ADDR'] = $remote_addr;
} else {
unset( $_SERVER['REMOTE_ADDR'] );
}
}
}