mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
[add] HTML Purifier added to clean code
This commit is contained in:
parent
c9bd17a100
commit
d4949327ef
362 changed files with 31430 additions and 0 deletions
48
inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
vendored
Normal file
48
inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Converts HTMLPurifier_ConfigSchema_Interchange to our runtime
|
||||
* representation used to perform checks on user configuration.
|
||||
*/
|
||||
class HTMLPurifier_ConfigSchema_Builder_ConfigSchema
|
||||
{
|
||||
|
||||
/**
|
||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||
* @return HTMLPurifier_ConfigSchema
|
||||
*/
|
||||
public function build($interchange)
|
||||
{
|
||||
$schema = new HTMLPurifier_ConfigSchema();
|
||||
foreach ($interchange->directives as $d) {
|
||||
$schema->add(
|
||||
$d->id->key,
|
||||
$d->default,
|
||||
$d->type,
|
||||
$d->typeAllowsNull
|
||||
);
|
||||
if ($d->allowed !== null) {
|
||||
$schema->addAllowedValues(
|
||||
$d->id->key,
|
||||
$d->allowed
|
||||
);
|
||||
}
|
||||
foreach ($d->aliases as $alias) {
|
||||
$schema->addAlias(
|
||||
$alias->key,
|
||||
$d->id->key
|
||||
);
|
||||
}
|
||||
if ($d->valueAliases !== null) {
|
||||
$schema->addValueAliases(
|
||||
$d->id->key,
|
||||
$d->valueAliases
|
||||
);
|
||||
}
|
||||
}
|
||||
$schema->postProcess();
|
||||
return $schema;
|
||||
}
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
Loading…
Add table
Add a link
Reference in a new issue