justijndepover / laravel-spam-keyword-validation
Laravel验证规则,用于检查常用垃圾邮件词汇
0.1.0
2022-09-27 16:06 UTC
Requires (Dev)
- orchestra/testbench: ^6.25|^7.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-27 20:45:24 UTC
README
此包为Laravel添加了一个验证规则,用于根据常用垃圾邮件词汇(如bitcoin
、cryptocurrency
等)阻止请求。完整列表请查看配置文件。
安装
您可以使用Composer安装此包
composer require justijndepover/laravel-spam-keyword-validation
安装后,您可以可选地发布您的配置文件
php artisan vendor:publish --tag="laravel-spam-keyword-validation-config"
配置
这是配置文件
<?php return [ /** * The list of keywords which cannot appear in the request value */ "keywords" => [ "http://", "https://", "www", "ftp://", "mailto:", "smb://", "afp://", "file://", "gopher://", "news://", "ssl://", "sslv2://", "sslv3://", "tls://", "tcp://", "udp://", "url=", "href=", "dating", "sex", "porn", "fuck", "free", "win", "buy", "captcha", "spam", "hello. and bye.", "mail.ru", "reading this message", "reading my message", "reading through my message", "are whitelisted", "great website", "late client", "ciao a tutti", "viagra", "cheap", "casino", "advertising", "keyword", "promotion", "porntubered", "ps: how are you?", "beautiful models", "privet", "beautiful girls", "best girls", "dosug", "trustable", "look at the", "v7bomdefex", "what is it -", "email marketing", "read your site", "crypto", "cryptography", "cryptocurrency", "bitcoin", "ethereum", "dogecoin", ], ];
用法
您可以使用blockSpamKeywords验证规则验证您的请求
$request->validate([ 'message' => ['blockSpamKeywords'], ]);
安全
如果您发现任何安全相关的问题,请提交问题或直接联系我:justijndepover@gmail.com。
贡献
如果您想对该包进行任何修改或改进,请随时提交pull request。
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。