Skip to content

Commit 81b41fe

Browse files
sanitize the item meta data html
1 parent c6cb6c9 commit 81b41fe

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

classes/plugin.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function __construct() {
172172

173173
// when email improvements feature enabled in woocommerce.
174174
if ( ppom_wc_email_improvements_enabled() ) {
175-
add_action( 'woocommerce_order_item_meta_end', 'ppom_woocommerce_order_itam_meta_html', 10, 4 );
175+
add_action( 'woocommerce_order_item_meta_end', 'ppom_woocommerce_order_item_meta_html', 10, 4 );
176176
add_filter( 'woocommerce_display_item_meta', '__return_empty_string' );
177177
} else {
178178
// Few inputs like file/crop/image need to show meta value in tags

inc/woocommerce.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,17 +1421,17 @@ function ppom_wc_order_again_compatibility( $cart_item_data, $item, $order ) {
14211421
* @param int $item_id The item ID.
14221422
* @param \WC_Order_Item_Product $item The order item object.
14231423
*/
1424-
function ppom_woocommerce_order_itam_meta_html( $item_id, $item ) {
1424+
function ppom_woocommerce_order_item_meta_html( $item_id, $item ) {
14251425
$formatted_meta = $item->get_formatted_meta_data();
14261426

14271427
$strings = array();
14281428
$meta_item_html = '';
14291429
$output_args = apply_filters( 'ppom_woocommerce_item_meta_args',
14301430
array(
1431-
'before' => '<div style="display: flex; flex-wrap: wrap; gap: 5px;">',
1431+
'before' => '<div>',
14321432
'after' => '</div>',
14331433
'separator' => '<br>',
1434-
'label_before' => '<span>',
1434+
'label_before' => '<span style="float: left;">',
14351435
'label_after' => ':</span> ',
14361436
)
14371437
);
@@ -1442,7 +1442,7 @@ function ppom_woocommerce_order_itam_meta_html( $item_id, $item ) {
14421442
if ( $strings ) {
14431443
$meta_item_html = implode( $output_args['separator'], $strings );
14441444
}
1445-
echo $meta_item_html;
1445+
echo wp_kses_post( $meta_item_html );
14461446
}
14471447

14481448
/**

0 commit comments

Comments
 (0)