微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

保护输入字段免受 ESI 威胁

如何解决保护输入字段免受 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 举报,一经查实,本站将立刻删除。