From 70619b5cdbd65cf23393c1b46abbbcc5c71a8b14 Mon Sep 17 00:00:00 2001 From: Manish Menaria Date: Thu, 1 Dec 2022 17:51:01 +0530 Subject: [PATCH] Escape values just before rendering (https://github.com/woocommerce/woocommerce-blocks/pull/7797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Escape all values in output of Product category list * Escape all values in output of Product Sale Badge * Escape values before rendering Whenever you’re rendering data, make sure to properly escape it. Escaping output prevents XSS (Cross-site scripting) attacks. * Remove unnecessary space Co-authored-by: Albert Juhé Lluveras Co-authored-by: Albert Juhé Lluveras --- .../src/BlockTypes/FeaturedProduct.php | 2 -- .../src/BlockTypes/MiniCart.php | 2 +- .../src/BlockTypes/ProductButton.php | 4 ++-- .../src/BlockTypes/ProductCategoryList.php | 19 ++++++++++++------- .../src/BlockTypes/ProductImage.php | 8 ++++---- .../src/BlockTypes/ProductSaleBadge.php | 14 ++++++++------ .../src/Utils/StyleAttributesUtils.php | 2 +- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/plugins/woocommerce-blocks/src/BlockTypes/FeaturedProduct.php b/plugins/woocommerce-blocks/src/BlockTypes/FeaturedProduct.php index 59240d84a16..9fcf1ca5950 100644 --- a/plugins/woocommerce-blocks/src/BlockTypes/FeaturedProduct.php +++ b/plugins/woocommerce-blocks/src/BlockTypes/FeaturedProduct.php @@ -1,8 +1,6 @@ + return '