ZenCart通过Contact Us接收垃圾邮件的过滤方案

最近收到一些通过Contact Us进行垃圾外链群发的邮件,虽然可以通过在Contact Us增加验证码来解决,但不利于客户体验。
所以我们可以通过简单的关键词过滤来实现,一般垃圾外链都含有“[url=”形式的代码

查找includesmodulespagescontact_usheader_php.php

// Send message
zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us');

修改为

// Send message
if(!strstr(strtolower($_POST['enquiry']), '[url=')){
  zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us');
}
转载请注明出处!小鱼阁工作室 -专注zencart建站,织梦企业建站,ecshop商城,二次开发,产品采集,模板修改!技术QQ 631992791
原文地址:https://www.cnblogs.com/afish/p/3920181.html