diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-03 06:33:11 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-03 06:33:11 -0400 |
commit | 2db86b950e78cb01cde659f424c9c01f79edc7a4 (patch) | |
tree | e57d9a81e15428395c171e17c5b0a05961a876ba /include/text.php | |
parent | 9619d02be988a5af7746fa5524b17e645f99d40d (diff) | |
parent | dccdeedb75874ac8a244770cc3be0bf9ee71a0cd (diff) | |
download | volse-hubzilla-2db86b950e78cb01cde659f424c9c01f79edc7a4.tar.gz volse-hubzilla-2db86b950e78cb01cde659f424c9c01f79edc7a4.tar.bz2 volse-hubzilla-2db86b950e78cb01cde659f424c9c01f79edc7a4.zip |
Merge remote-tracking branch 'upstream/dev' into plugin-repo
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index c61c5fbd4..66a49d4b5 100644 --- a/include/text.php +++ b/include/text.php @@ -122,7 +122,7 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') { -function purify_html($s) { +function purify_html($s, $allow_position = false) { require_once('library/HTMLPurifier.auto.php'); require_once('include/html2bbcode.php'); @@ -202,6 +202,35 @@ function purify_html($s) { $def->addElement('header', 'Block', 'Flow', 'Common'); $def->addElement('footer', 'Block', 'Flow', 'Common'); + + if($allow_position) { + $cssDefinition = $config->getCSSDefinition(); + + $cssDefinition->info['position'] = new HTMLPurifier_AttrDef_Enum(array('absolute', 'fixed', 'relative', 'static', 'inherit'), false); + + $cssDefinition->info['left'] = new HTMLPurifier_AttrDef_CSS_Composite(array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage() + )); + + $cssDefinition->info['right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage() + )); + + $cssDefinition->info['top'] = new HTMLPurifier_AttrDef_CSS_Composite(array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage() + )); + + $cssDefinition->info['bottom'] = new HTMLPurifier_AttrDef_CSS_Composite(array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage() + )); + + } + + $purifier = new HTMLPurifier($config); return $purifier->purify($s); |