简体   繁体   English

使用php中的正则表达式过滤URL

[英]Filter URL's with regular expressions in php

What I'm trying to do is to block any kind of url and links posted on my site, The thing is that these people started posting these links like that for example: 我想要做的是阻止在我的网站上发布的任何类型的网址和链接,事实是这些人开始发布这样的链接,例如:

W/W/W.DOMAIN.C/O/M
W//W//W//.DOMAIN.C//O//M

They are using many different variations, and I don't know what to do in order to block them all. 他们使用了许多不同的变体,我不知道该怎么做才能阻止它们。 Thank you 谢谢

You should consider using a spam-checking service like akismet and incorporate that into your site. 您应该考虑使用像akismet这样的垃圾邮件检查服务,并将其合并到您的网站中。 It will help you catch spam like that. 它会帮助你抓住这样的垃圾邮件。

This way, you wont have to struggle with regex. 这样,你就不必与正则表达式斗争。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM