aboutsummaryrefslogtreecommitdiffstats
path: root/library/HTMLPurifier/HTMLModule/Legacy.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-01 22:18:27 -0800
committerfriendica <info@friendica.com>2015-01-01 22:18:27 -0800
commita0052f0176bd079e6a94baec59fea2ec5a8d651e (patch)
treec323edd823681bc2e8ca757e7eaf8354d42c7b51 /library/HTMLPurifier/HTMLModule/Legacy.php
parent545e47933a0816699c68d98a7742a03260d6a54f (diff)
downloadvolse-hubzilla-a0052f0176bd079e6a94baec59fea2ec5a8d651e.tar.gz
volse-hubzilla-a0052f0176bd079e6a94baec59fea2ec5a8d651e.tar.bz2
volse-hubzilla-a0052f0176bd079e6a94baec59fea2ec5a8d651e.zip
htmlpurifier update - compatibility issue with language library autoloader
Diffstat (limited to 'library/HTMLPurifier/HTMLModule/Legacy.php')
-rw-r--r--library/HTMLPurifier/HTMLModule/Legacy.php89
1 files changed, 66 insertions, 23 deletions
diff --git a/library/HTMLPurifier/HTMLModule/Legacy.php b/library/HTMLPurifier/HTMLModule/Legacy.php
index df33927ba..86b529957 100644
--- a/library/HTMLPurifier/HTMLModule/Legacy.php
+++ b/library/HTMLPurifier/HTMLModule/Legacy.php
@@ -18,29 +18,58 @@
class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
{
-
+ /**
+ * @type string
+ */
public $name = 'Legacy';
- public function setup($config) {
-
- $this->addElement('basefont', 'Inline', 'Empty', false, array(
- 'color' => 'Color',
- 'face' => 'Text', // extremely broad, we should
- 'size' => 'Text', // tighten it
- 'id' => 'ID'
- ));
+ /**
+ * @param HTMLPurifier_Config $config
+ */
+ public function setup($config)
+ {
+ $this->addElement(
+ 'basefont',
+ 'Inline',
+ 'Empty',
+ null,
+ array(
+ 'color' => 'Color',
+ 'face' => 'Text', // extremely broad, we should
+ 'size' => 'Text', // tighten it
+ 'id' => 'ID'
+ )
+ );
$this->addElement('center', 'Block', 'Flow', 'Common');
- $this->addElement('dir', 'Block', 'Required: li', 'Common', array(
- 'compact' => 'Bool#compact'
- ));
- $this->addElement('font', 'Inline', 'Inline', array('Core', 'I18N'), array(
- 'color' => 'Color',
- 'face' => 'Text', // extremely broad, we should
- 'size' => 'Text', // tighten it
- ));
- $this->addElement('menu', 'Block', 'Required: li', 'Common', array(
- 'compact' => 'Bool#compact'
- ));
+ $this->addElement(
+ 'dir',
+ 'Block',
+ 'Required: li',
+ 'Common',
+ array(
+ 'compact' => 'Bool#compact'
+ )
+ );
+ $this->addElement(
+ 'font',
+ 'Inline',
+ 'Inline',
+ array('Core', 'I18N'),
+ array(
+ 'color' => 'Color',
+ 'face' => 'Text', // extremely broad, we should
+ 'size' => 'Text', // tighten it
+ )
+ );
+ $this->addElement(
+ 'menu',
+ 'Block',
+ 'Required: li',
+ 'Common',
+ array(
+ 'compact' => 'Bool#compact'
+ )
+ );
$s = $this->addElement('s', 'Inline', 'Inline', 'Common');
$s->formatting = true;
@@ -89,7 +118,7 @@ class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
$hr->attr['width'] = 'Length';
$img = $this->addBlankElement('img');
- $img->attr['align'] = 'Enum#top,middle,bottom,left,right';
+ $img->attr['align'] = 'IAlign';
$img->attr['border'] = 'Pixels';
$img->attr['hspace'] = 'Pixels';
$img->attr['vspace'] = 'Pixels';
@@ -98,7 +127,7 @@ class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
$li = $this->addBlankElement('li');
$li->attr['value'] = new HTMLPurifier_AttrDef_Integer();
- $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle';
+ $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle';
$ol = $this->addBlankElement('ol');
$ol->attr['compact'] = 'Bool#compact';
@@ -136,8 +165,22 @@ class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
$ul->attr['compact'] = 'Bool#compact';
$ul->attr['type'] = 'Enum#square,disc,circle';
- }
+ // "safe" modifications to "unsafe" elements
+ // WARNING: If you want to add support for an unsafe, legacy
+ // attribute, make a new TrustedLegacy module with the trusted
+ // bit set appropriately
+ $form = $this->addBlankElement('form');
+ $form->content_model = 'Flow | #PCDATA';
+ $form->content_model_type = 'optional';
+ $form->attr['target'] = 'FrameTarget';
+
+ $input = $this->addBlankElement('input');
+ $input->attr['align'] = 'IAlign';
+
+ $legend = $this->addBlankElement('legend');
+ $legend->attr['align'] = 'LAlign';
+ }
}
// vim: et sw=4 sts=4