删除用户php 中消息帖子的个人信息
我已经实现了一个 php/codeigniter 消息系统,并希望阻止用户发布他们的电话号码、地址、电子邮件、网站或任何其他可能允许用户在我们的消息系统之外进行联系的内容。
有谁知道任何可用的插件或代码可以从文本中删除此类个人信息?
谢谢
I have implemented a php/codeigniter messaging system and want to prevent users from posting their phone numbers, addresses, e-mails, websites or anything else that might allow for user contact outside of our messaging system.
Does anyone know of any available plugins or code that would remove such personal information from text?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这确实是一项艰巨的任务,您不能 100% 确定您会阻止提交此类信息。
您可以轻松地阻止发布电子邮件和网址(当然,以 ISO 标准形式),但对于电话号码和地址来说,这将是真正的痛苦。
[email protected]
可以表示为 < code>email at email.com 或email[at]email.com
等。http://www.google.com
可以表示为google dot com
等。验证地址对我来说似乎是一项无法解决的任务。 1-1 = 圣。绿色的
房子#1,公寓#1;验证这样的字符串几乎是不可能的。
电话也可能是伪造的(1 121 123 43 23 => 1 一二一...)。
我建议你简化你的任务。这真是浪费时间,恕我直言。
PS:如果您决定解决此任务,那么
正则表达式
将对您有很大帮助,这将是宝贵的经验,它将提高您的开发技能!It is really difficult task and you can't be 100% sure that you'll prevent submitting such information.
You can easily prevent from posting emails and urls (in ISO standart form, of course), but it will be real pain in the ass for phone numbers and addresses.
[email protected]
can be represented asemail at email.com
oremail[at]email.com
etc.http://www.google.com
can be represented asgoogle dot com
etc.Validating addresses seems me to be unresolvable task at all Green st. 1-1 = st. Green
house #1, flat#1; It's almost impossible to validate such strings.
Phone could be faked as well (1 121 123 43 23 => 1 one-two-one ...).
I advice you to simplify your task. It is real wasting of time, imho.
PS: If you'll decide to solve this task, then
regular expressions
will help you a lot and it will be invaluable experience that will make your developer skill higher!