sanitize coupon class names

Closes #7802
This commit is contained in:
Mike Jolley 2015-03-27 15:38:57 +00:00
parent 65bc9db763
commit 3b547c4218
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
</tr>
<?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
<tr class="cart-discount coupon-<?php echo esc_attr( $code ); ?>">
<tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
<th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
<td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
</tr>

View File

@ -52,7 +52,7 @@ if ( ! defined( 'ABSPATH' ) ) {
</tr>
<?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
<tr class="cart-discount coupon-<?php echo esc_attr( $code ); ?>">
<tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
<th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
<td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
</tr>