woocommerce / bookings-helper

This extension is a WooCommerce Bookings helper which helps you to troubleshoot bookings setup easier by allowing you to quickly export/import product settings.
32 stars 6 forks source link

Booking Product imported by Booking Helper, doesn't have formatting in content #34

Open ankitguptaindia opened 1 year ago

ankitguptaindia commented 1 year ago

If a booking product has content with formatting, imported version of booking product doesn't have those formatting.

Original Booking Content -

image

Imported Booking Content-

image

Steps -

  1. Create a booking product with some content in the editor
  2. Make content bold, heading, an ordered list, an unordered list, etc
  3. Export the product with the help of Booking Helper
  4. Import that product again and check the content of the booking.

Not sure if this scenario is considered or not at the time of designing this plugin. Feel free to close this issue if this is intentional.

ankitguptaindia commented 1 year ago

@jeffpaul As discussed on 1:1, I added this case here for discussion/fix

cc: @vikrampm1

faisal-alvi commented 1 year ago

Thanks for the report, @ankitguptaindia.

There seems to be an issue with the use of sanitize_text_field on the content before importing, as seen in this line of code:

https://github.com/woocommerce/bookings-helper/blob/97a54b44a76369a65ec57ce0e8f84d92622f8218/includes/class-wc-bookings-helper-import.php#L194

A possible solution would be to use wp_kses_post instead.