https://github.com/vdlp/oc-htmlpurifier-plugin
Adds a standards compliant HTML filter to October CMS.
https://github.com/vdlp/oc-htmlpurifier-plugin
filter htmlpurifier october-cms octobercms php standards-compliant
Last synced: about 1 year ago
JSON representation
Adds a standards compliant HTML filter to October CMS.
- Host: GitHub
- URL: https://github.com/vdlp/oc-htmlpurifier-plugin
- Owner: vdlp
- License: gpl-2.0
- Created: 2018-07-18T12:21:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-14T13:48:31.000Z (about 2 years ago)
- Last Synced: 2025-04-11T12:24:57.802Z (about 1 year ago)
- Topics: filter, htmlpurifier, october-cms, octobercms, php, standards-compliant
- Language: PHP
- Size: 347 KB
- Stars: 2
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
# Vdlp.HtmlPurifier
An October CMS plugin which adds a standards compliant HTML filter to October CMS.
HTML Purifier is an HTML filtering solution that uses a unique combination of robust whitelists and agressive parsing to ensure that not only are XSS attacks thwarted, but the resulting HTML is standards compliant.
## Installation
**CLI:**
`php artisan plugin:install Vdlp.HtmlPurifier`
**October CMS:**
Go to Settings > Updates & Plugins > Install plugins and search for 'HtmlPurifier'.
## Configuration
To configure the filter execute this command:
````
php artisan vendor:publish --provider="Vdlp\HtmlPurifier\HtmlPurifierServiceProvider" --tag="config"
````
A configuration file named `config/htmlpurifier.php` is now created.
In depth information about configuration parameters can be found here: http://htmlpurifier.org/live/configdoc/plain.html
## Usage
Use the `|purify' in your Twig templates to apply the HTML Purifier filter.
````
{{ contentFromCms|purify }}
{{ contentFromExternalSource|purify }}
````
or
````
{{ 'Some random HTML string'|purify }}
````
For more information about templating in October CMS: http://octobercms.com/docs/markup/templating