PHP code example of distilleries / security

1. Go to this page and download the library: Download distilleries/security library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

distilleries / security example snippets


    return [
       'xss_enable'=> env('SECURITY_XSS_ENABLE',true),
       'html_purifier'=> env('SECURITY_HTML_PURIFIER_ENABLE',true)
    ];


    protected $middleware = [
        \Distilleries\Security\Http\Middleware\XSS::class
    ];

    $xss = new \Distilleries\Security\Helpers\Security();
    $xss->xss_clean('<a href="javascript:aler('test')">Click to alert</a>');

    $xss = new \Distilleries\Security\Helpers\Security();
    $xss->entity_decode(&lt;a href=&quot;javascript:alert('test')&quot;&gt;Test&lt;/a&gt;');

    $xss = new \Distilleries\Security\Helpers\Security();
    $xss->sanitize_filename('./../test.jgp',true);

    $xss = new \Distilleries\Security\Helpers\Security();
    $xss->sanitize_filename('./../test.jgp',false);
ssh
php artisan vendor:publish --provider="Distilleries\Security\SecurityServiceProvider"