Merge pull request #15816 from woocommerce/fix/15808

Add slashes to meta value in data store before passing to WP functions
This commit is contained in:
Claudio Sanches 2017-06-27 13:03:13 -03:00 committed by GitHub
commit fe542d4d4e
1 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ class WC_Data_Store_WP {
* @return int meta ID
*/
public function add_meta( &$object, $meta ) {
return add_metadata( $this->meta_type, $object->get_id(), $meta->key, $meta->value, false );
return add_metadata( $this->meta_type, $object->get_id(), $meta->key, wp_slash( $meta->value ), false );
}
/**
@ -111,7 +111,7 @@ class WC_Data_Store_WP {
* @param stdClass (containing ->id, ->key and ->value)
*/
public function update_meta( &$object, $meta ) {
update_metadata_by_mid( $this->meta_type, $meta->id, $meta->value, $meta->key );
update_metadata_by_mid( $this->meta_type, $meta->id, wp_slash( $meta->value ), $meta->key );
}
/**