保护输入字段免受 ESI 威胁

问题描述

我在我的网站上进行了扫描,并在我的购物车页面上收到了关于 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>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)