{"repo":"stevebauman/purify","free":true,"listed":false,"github":"https://github.com/stevebauman/purify","clone":"git clone https://github.com/stevebauman/purify.git","description":"A Laravel wrapper for HTMLPurifier by ezyang","language":"PHP","stars":538,"topics":["php","html-purifier","html-sanitizer","laravel"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Purify A Laravel wrapper for HTMLPurifier by ezyang . Index - Requirements - Installation - Usage - Configuration - Cache - Practices - Upgrading from v4 to v5 - Upgrading from v5 to v6 Requirements - PHP = 7.4 - Laravel = 7.0 Installation To install Purify, run the following command in the root of your project: Then, publish the configuration file using: Usage Cleaning a String To clean a users input, simply use the clean method: Cleaning an Array Need to purify an array of user input? Just pass in an array: Dynamic Configuration Need a different configuration for a single input? Pass in a configuration array to the config method: Note : Configuration passed into the config method is not merged with your default configuration. Configuration Inside the configuration file, multiple HTMLPurifier configuration sets can be specified, similar to Laravel's built-in database , mail and logging config. Simply call Purify::config($name)- clean($input) to use another set of configuration. For example, if we need to have a separate configuration for a comment system, we can setup this configuration in the config/purify.php file: Then, utilize it anywhere in your application by its name: For HTMLPurifier configuration documentation, please visit the HTMLPurifier Website: http://htmlpurifier.org/live/configdoc/plain.html Cache After running Purify once, HTMLPurifier will auto-cache your serialized definitions into the serializer.cache definition you have configured in config/purify.php . ","default_branch":null,"files":null,"tree":[],"storefront":"/r/stevebauman","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/stevebauman/purify/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}