我在我的网站上进行了扫描,并在我的购物车页面上收到了关于 ESI(边缘侧包含注入)的严重威胁。我唯一的输入字段是优惠券代码的输入字段。
我收集到的是我应该对输入进行转义,并且一直在查看 htmlentities() 函数,但不确定如何应用它。
解决这个问题的最佳方法是什么?
相关 HTML:
<div class="component-5">
<div class="discount-input">
<input type="text" name="coupon_code" class="input-text" id="coupon_code" placeholder="<?=get_field('text_discountcode_placeholder', 'option')?>" />
</div>
</div>
<div class="component">
<button type="submit" name="apply_coupon" value="<?php esc_attr_e('Apply coupon', 'woocommerce'); ?>" class="btn" target="_self">
<?=$textAdd?>
</button>
</div>