Merge pull request #21074 from woocommerce/fix/21026
Fixes two product attributes issues when non-ASCII characters are used in the attribute name
This commit is contained in:
commit
6eea244a28
|
@ -978,7 +978,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set low stock amount.
|
||||
*
|
||||
* @param int|string $amount Empty string if value not set
|
||||
* @param int|string $amount Empty string if value not set.
|
||||
* @since 3.5.0
|
||||
*/
|
||||
public function set_low_stock_amount( $amount ) {
|
||||
|
@ -1104,7 +1104,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$attributes = array_fill_keys( array_keys( $this->get_attributes( 'edit' ) ), null );
|
||||
foreach ( $raw_attributes as $attribute ) {
|
||||
if ( is_a( $attribute, 'WC_Product_Attribute' ) ) {
|
||||
$attributes[ sanitize_title( $attribute->get_name() ) ] = $attribute;
|
||||
$attributes[ sanitize_text_field( $attribute->get_name() ) ] = $attribute;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
|
|||
continue;
|
||||
}
|
||||
|
||||
$filter_name = 'filter_' . sanitize_title( str_replace( 'pa_', '', $taxonomy ) );
|
||||
$filter_name = 'filter_' . str_replace( 'pa_', '', $taxonomy );
|
||||
$current_filter = isset( $_GET[ $filter_name ] ) ? explode( ',', wc_clean( wp_unslash( $_GET[ $filter_name ] ) ) ) : array(); // WPCS: input var ok, CSRF ok.
|
||||
$current_filter = array_map( 'sanitize_title', $current_filter );
|
||||
|
||||
|
|
Loading…
Reference in New Issue