WPDB: When sanity checking a string, check that it's a string, first - PHP notices can occur if an array or object is handled like a string.

See #21212


git-svn-id: https://develop.svn.wordpress.org/trunk@31094 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2015-01-08 08:44:10 +00:00
parent befcf4f442
commit ceccfa10b4

View File

@ -2513,7 +2513,7 @@ class wpdb {
* @return string|WP_Error The converted string, or a `WP_Error` object if the conversion fails.
*/
public function strip_invalid_text_for_column( $table, $column, $value ) {
if ( $this->check_ascii( $value ) || ! is_string( $value ) ) {
if ( ! is_string( $value ) || $this->check_ascii( $value ) ) {
return $value;
}