strip html tags from description.

To prevent HTML tags being present in the PayPal dialog, we need to strip HTML tags when we create the items for a purchase unit.
This commit is contained in:
David Remer 2020-11-03 14:39:57 +02:00
parent 97c78b02a9
commit 1b2ac3aed8

View file

@ -48,7 +48,7 @@ class ItemFactory {
mb_substr( $product->get_name(), 0, 127 ),
new Money( $price_without_tax_rounded, $currency ),
$quantity,
mb_substr( $product->get_description(), 0, 127 ),
mb_substr( wp_strip_all_tags( $product->get_description() ), 0, 127 ),
$tax,
$product->get_sku(),
( $product->is_virtual() ) ? Item::DIGITAL_GOODS : Item::PHYSICAL_GOODS
@ -102,7 +102,7 @@ class ItemFactory {
mb_substr( $product->get_name(), 0, 127 ),
new Money( $price_without_tax_rounded, $currency ),
$quantity,
mb_substr( $product->get_description(), 0, 127 ),
mb_substr( wp_strip_all_tags( $product->get_description() ), 0, 127 ),
$tax,
$product->get_sku(),
( $product->is_virtual() ) ? Item::DIGITAL_GOODS : Item::PHYSICAL_GOODS