Merge pull request #14036 from woocommerce/fix/14032

Make sure we have a prefix for strstr
This commit is contained in:
Claudio Sanches 2017-04-06 10:25:46 -03:00 committed by GitHub
commit 9a219b71da
1 changed files with 4 additions and 1 deletions

View File

@ -75,11 +75,14 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
*/
protected function exclude_internal_meta_keys( $meta ) {
global $wpdb;
$table_prefix = $wpdb->prefix ? $wpdb->prefix : 'wp_';
return ! in_array( $meta->meta_key, $this->internal_meta_keys )
&& 0 !== strpos( $meta->meta_key, 'closedpostboxes_' )
&& 0 !== strpos( $meta->meta_key, 'metaboxhidden_' )
&& 0 !== strpos( $meta->meta_key, 'manageedit-' )
&& ! strstr( $meta->meta_key, $wpdb->prefix )
&& ! strstr( $meta->meta_key, $table_prefix )
&& 0 !== stripos( $meta->meta_key, 'wp_' );
}