Merge pull request #21936 from woocommerce/fix/21878

Use wp_kses_post for sanitizing product names instead of esc_html
This commit is contained in:
Rodrigo Primo 2018-11-22 10:54:57 -02:00 committed by GitHub
commit a096e2729a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ $row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empt
</td>
<td class="name" data-sort-value="<?php echo esc_attr( $item->get_name() ); ?>">
<?php
echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . esc_html( $item->get_name() ) . '</a>' : '<div class="wc-order-item-name">' . esc_html( $item->get_name() ) . '</div>';
echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</a>' : '<div class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</div>';
if ( $product && $product->get_sku() ) {
echo '<div class="wc-order-item-sku"><strong>' . esc_html__( 'SKU:', 'woocommerce' ) . '</strong> ' . esc_html( $product->get_sku() ) . '</div>';

View File

@ -30,7 +30,7 @@ if ( ! is_a( $product, 'WC_Product' ) ) {
<a href="<?php echo esc_url( $product->get_permalink() ); ?>">
<?php echo $product->get_image(); ?>
<span class="product-title"><?php echo esc_html( $product->get_name() ); ?></span>
<span class="product-title"><?php echo wp_kses_post( $product->get_name() ); ?></span>
</a>
<?php if ( ! empty( $show_rating ) ) : ?>