-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPlugin.php
40 lines (34 loc) · 1.01 KB
/
Plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace Vdlp\HtmlPurifier;
use HTMLPurifier;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function pluginDetails(): array
{
return [
'name' => 'vdlp.htmlpurifier::lang.plugin.name',
'description' => 'vdlp.htmlpurifier::lang.plugin.description',
'author' => 'Van der Let & Partners <[email protected]>',
'icon' => 'icon-leaf',
'homepage' => 'https://github.com/vdlp/oc-htmlpurifier-plugin',
];
}
public function boot(): void
{
$this->app->register(HtmlPurifierServiceProvider::class);
}
public function registerMarkupTags(): array
{
return [
'filters' => [
'purify' => function ($html) {
/** @var HTMLPurifier $purifier */
$purifier = $this->app->make(HTMLPurifier::class);
return $purifier->purify($html);
},
],
];
}
}