afish

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

查找includes\modules\pages\contact_us\header_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\');
}

 

分类:

技术点:

相关文章: