nayikidev/laravel-validate-xss
最新稳定版本:v1.0.1
Composer 安装命令:
composer require nayikidev/laravel-validate-xss
包简介
Laravel validation rule to prevent JavaScript or dangerous HTML tags.
README 文档
README
A lightweight Laravel package that provides a custom validation rule to prevent Cross-Site Scripting (XSS) attacks in user input.
🚀 Features
✅ Detects and blocks:
<script>tags- Inline JavaScript attributes (e.g.,
onclick,onload, etc.) - Dangerous input patterns like
javascript:or<img onerror=...>
✅ Works with Laravel’s built-in Validator and FormRequest
✅ Plug-and-play: no config required
Minimum Requirements
- PHP >= 8.1
- Laravel 10.x
- Composer
🧩 Installation
1️⃣ Add to your Laravel project
composer require nayikidev/laravel-validate-xss
Using the Validation Rule
'field' => ['xss_protection']
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-30