Tag stripped outside template
Stripping only affects aria-label attribute now.
This commit is contained in:
parent
b6860803a5
commit
86f1b3701f
|
@ -893,6 +893,10 @@ if ( ! function_exists( 'woocommerce_template_loop_add_to_cart' ) ) {
|
|||
|
||||
$args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );
|
||||
|
||||
if ( array_key_exists( 'attributes', $args ) && array_key_exists( 'aria-label', $args['attributes'] ) ) {
|
||||
$args['attributes']['aria-label'] = strip_tags( $args['attributes']['aria-label'] );
|
||||
}
|
||||
|
||||
wc_get_template( 'loop/add-to-cart.php', $args );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
@ -26,7 +27,7 @@ echo apply_filters( 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
|
|||
esc_url( $product->add_to_cart_url() ),
|
||||
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
|
||||
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
|
||||
isset( $args['attributes'] ) ? wc_implode_html_attributes( array_map( 'strip_tags', $args['attributes'] ) ) : '',
|
||||
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
|
||||
esc_html( $product->add_to_cart_text() )
|
||||
),
|
||||
$product, $args );
|
||||
|
|
Loading…
Reference in New Issue