Download the PHP package baddiservices/safehtml without Composer
On this page you can find all versions of the php package baddiservices/safehtml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download baddiservices/safehtml
More information about baddiservices/safehtml
Files in baddiservices/safehtml
Download baddiservices/safehtml
More information about baddiservices/safehtml
Files in baddiservices/safehtml
Vendor baddiservices
Package safehtml
Short Description Safe HTML package help to prevent XSS vulnerability via HTML content
License MIT
Package safehtml
Short Description Safe HTML package help to prevent XSS vulnerability via HTML content
License MIT
Please rate this library. Is it a good library?
Informations about the package safehtml
Safe HTML
Safe HTML package help to prevent XSS vulnerability via HTML content.
Installation
Use Composer to install the package:
Examples
Validate the input is HTML or not
Prevent XSS from HTML
Prevent XSS from text
Prevent XSS from link
Available methods
Method | Description |
---|---|
validate($value) |
Verify text is HTML |
sanitize($value) |
Sanitize text to prevent HTML tags |
sanitizeAll($values) |
Sanitize array of texts to prevent HTML tags |
sanitizeHTML($value) |
Sanitize HTML to prevent XSS vulnerability |
encodeEntities($value) |
Encode special characters to HTML entities |
decodeEntities($value) |
Decode HTML entities to their corresponding characters |
setBlackListPath($blackListPath) |
Set a custom path of the blacklist json file |
getEncoding() |
Get characters encoding |
setEncoding($encodage) |
Set characters encoding |
Blacklist file example
You can check the blacklist used by default
Exceptions
Name | Code | Description |
---|---|---|
BlackListNotLoadedException | 11 | Failed to load blacklist file |
Contribute
Contributions to the package are always welcome!
- Report any bugs or issues you find.
- Clone the code source and submit your pull request.
All versions of safehtml with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
ext-dom Version *
ext-libxml Version *
ext-mbstring Version *
ext-dom Version *
ext-libxml Version *
ext-mbstring Version *
The package baddiservices/safehtml contains the following files
Loading the files please wait ....