Merge pull request #24385 from woocommerce/fix/24356

Ensure WC_Product_Data_Store_CPT::is_existing_sku() return boolean
This commit is contained in:
Rodrigo Primo 2019-08-21 16:52:13 -03:00 committed by GitHub
commit c3262eea3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -949,7 +949,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
global $wpdb;
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
return $wpdb->get_var(
return (bool) $wpdb->get_var(
$wpdb->prepare(
"
SELECT posts.ID
@ -1088,7 +1088,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$query .= ' AND postmeta.meta_key IN ( "' . implode( '","', array_map( 'esc_sql', $meta_attribute_names ) ) . '" )';
$query.=' ORDER BY posts.menu_order ASC, postmeta.post_id ASC;';
$query .= ' ORDER BY posts.menu_order ASC, postmeta.post_id ASC;';
$attributes = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared