@@ -6,37 +6,37 @@ |
||
6 | 6 | class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule |
7 | 7 | { |
8 | 8 | |
9 | - public $name = 'List'; |
|
10 | - |
|
11 | - // According to the abstract schema, the List content set is a fully formed |
|
12 | - // one or more expr, but it invariably occurs in an optional declaration |
|
13 | - // so we're not going to do that subtlety. It might cause trouble |
|
14 | - // if a user defines "List" and expects that multiple lists are |
|
15 | - // allowed to be specified, but then again, that's not very intuitive. |
|
16 | - // Furthermore, the actual XML Schema may disagree. Regardless, |
|
17 | - // we don't have support for such nested expressions without using |
|
18 | - // the incredibly inefficient and draconic Custom ChildDef. |
|
19 | - |
|
20 | - public $content_sets = array('Flow' => 'List'); |
|
21 | - |
|
22 | - public function setup($config) { |
|
23 | - $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); |
|
24 | - $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); |
|
25 | - // XXX The wrap attribute is handled by MakeWellFormed. This is all |
|
26 | - // quite unsatisfactory, because we generated this |
|
27 | - // *specifically* for lists, and now a big chunk of the handling |
|
28 | - // is done properly by the List ChildDef. So actually, we just |
|
29 | - // want enough information to make autoclosing work properly, |
|
30 | - // and then hand off the tricky stuff to the ChildDef. |
|
31 | - $ol->wrap = 'li'; |
|
32 | - $ul->wrap = 'li'; |
|
33 | - $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); |
|
34 | - |
|
35 | - $this->addElement('li', false, 'Flow', 'Common'); |
|
36 | - |
|
37 | - $this->addElement('dd', false, 'Flow', 'Common'); |
|
38 | - $this->addElement('dt', false, 'Inline', 'Common'); |
|
39 | - } |
|
9 | + public $name = 'List'; |
|
10 | + |
|
11 | + // According to the abstract schema, the List content set is a fully formed |
|
12 | + // one or more expr, but it invariably occurs in an optional declaration |
|
13 | + // so we're not going to do that subtlety. It might cause trouble |
|
14 | + // if a user defines "List" and expects that multiple lists are |
|
15 | + // allowed to be specified, but then again, that's not very intuitive. |
|
16 | + // Furthermore, the actual XML Schema may disagree. Regardless, |
|
17 | + // we don't have support for such nested expressions without using |
|
18 | + // the incredibly inefficient and draconic Custom ChildDef. |
|
19 | + |
|
20 | + public $content_sets = array('Flow' => 'List'); |
|
21 | + |
|
22 | + public function setup($config) { |
|
23 | + $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); |
|
24 | + $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); |
|
25 | + // XXX The wrap attribute is handled by MakeWellFormed. This is all |
|
26 | + // quite unsatisfactory, because we generated this |
|
27 | + // *specifically* for lists, and now a big chunk of the handling |
|
28 | + // is done properly by the List ChildDef. So actually, we just |
|
29 | + // want enough information to make autoclosing work properly, |
|
30 | + // and then hand off the tricky stuff to the ChildDef. |
|
31 | + $ol->wrap = 'li'; |
|
32 | + $ul->wrap = 'li'; |
|
33 | + $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); |
|
34 | + |
|
35 | + $this->addElement('li', false, 'Flow', 'Common'); |
|
36 | + |
|
37 | + $this->addElement('dd', false, 'Flow', 'Common'); |
|
38 | + $this->addElement('dt', false, 'Inline', 'Common'); |
|
39 | + } |
|
40 | 40 | |
41 | 41 | } |
42 | 42 |
@@ -3,18 +3,18 @@ |
||
3 | 3 | class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule |
4 | 4 | { |
5 | 5 | |
6 | - public $name = 'Name'; |
|
6 | + public $name = 'Name'; |
|
7 | 7 | |
8 | - public function setup($config) { |
|
9 | - $elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map'); |
|
10 | - foreach ($elements as $name) { |
|
11 | - $element = $this->addBlankElement($name); |
|
12 | - $element->attr['name'] = 'CDATA'; |
|
13 | - if (!$config->get('HTML.Attr.Name.UseCDATA')) { |
|
14 | - $element->attr_transform_post['NameSync'] = new HTMLPurifier_AttrTransform_NameSync(); |
|
15 | - } |
|
16 | - } |
|
17 | - } |
|
8 | + public function setup($config) { |
|
9 | + $elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map'); |
|
10 | + foreach ($elements as $name) { |
|
11 | + $element = $this->addBlankElement($name); |
|
12 | + $element->attr['name'] = 'CDATA'; |
|
13 | + if (!$config->get('HTML.Attr.Name.UseCDATA')) { |
|
14 | + $element->attr_transform_post['NameSync'] = new HTMLPurifier_AttrTransform_NameSync(); |
|
15 | + } |
|
16 | + } |
|
17 | + } |
|
18 | 18 | |
19 | 19 | } |
20 | 20 |
@@ -7,12 +7,12 @@ |
||
7 | 7 | class HTMLPurifier_HTMLModule_Nofollow extends HTMLPurifier_HTMLModule |
8 | 8 | { |
9 | 9 | |
10 | - public $name = 'Nofollow'; |
|
10 | + public $name = 'Nofollow'; |
|
11 | 11 | |
12 | - public function setup($config) { |
|
13 | - $a = $this->addBlankElement('a'); |
|
14 | - $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow(); |
|
15 | - } |
|
12 | + public function setup($config) { |
|
13 | + $a = $this->addBlankElement('a'); |
|
14 | + $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow(); |
|
15 | + } |
|
16 | 16 | |
17 | 17 | } |
18 | 18 |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | class HTMLPurifier_HTMLModule_NonXMLCommonAttributes extends HTMLPurifier_HTMLModule |
4 | 4 | { |
5 | - public $name = 'NonXMLCommonAttributes'; |
|
5 | + public $name = 'NonXMLCommonAttributes'; |
|
6 | 6 | |
7 | - public $attr_collections = array( |
|
8 | - 'Lang' => array( |
|
9 | - 'lang' => 'LanguageCode', |
|
10 | - ) |
|
11 | - ); |
|
7 | + public $attr_collections = array( |
|
8 | + 'Lang' => array( |
|
9 | + 'lang' => 'LanguageCode', |
|
10 | + ) |
|
11 | + ); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // vim: et sw=4 sts=4 |
@@ -8,39 +8,39 @@ |
||
8 | 8 | class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule |
9 | 9 | { |
10 | 10 | |
11 | - public $name = 'Object'; |
|
12 | - public $safe = false; |
|
13 | - |
|
14 | - public function setup($config) { |
|
15 | - |
|
16 | - $this->addElement('object', 'Inline', 'Optional: #PCDATA | Flow | param', 'Common', |
|
17 | - array( |
|
18 | - 'archive' => 'URI', |
|
19 | - 'classid' => 'URI', |
|
20 | - 'codebase' => 'URI', |
|
21 | - 'codetype' => 'Text', |
|
22 | - 'data' => 'URI', |
|
23 | - 'declare' => 'Bool#declare', |
|
24 | - 'height' => 'Length', |
|
25 | - 'name' => 'CDATA', |
|
26 | - 'standby' => 'Text', |
|
27 | - 'tabindex' => 'Number', |
|
28 | - 'type' => 'ContentType', |
|
29 | - 'width' => 'Length' |
|
30 | - ) |
|
31 | - ); |
|
32 | - |
|
33 | - $this->addElement('param', false, 'Empty', false, |
|
34 | - array( |
|
35 | - 'id' => 'ID', |
|
36 | - 'name*' => 'Text', |
|
37 | - 'type' => 'Text', |
|
38 | - 'value' => 'Text', |
|
39 | - 'valuetype' => 'Enum#data,ref,object' |
|
40 | - ) |
|
41 | - ); |
|
42 | - |
|
43 | - } |
|
11 | + public $name = 'Object'; |
|
12 | + public $safe = false; |
|
13 | + |
|
14 | + public function setup($config) { |
|
15 | + |
|
16 | + $this->addElement('object', 'Inline', 'Optional: #PCDATA | Flow | param', 'Common', |
|
17 | + array( |
|
18 | + 'archive' => 'URI', |
|
19 | + 'classid' => 'URI', |
|
20 | + 'codebase' => 'URI', |
|
21 | + 'codetype' => 'Text', |
|
22 | + 'data' => 'URI', |
|
23 | + 'declare' => 'Bool#declare', |
|
24 | + 'height' => 'Length', |
|
25 | + 'name' => 'CDATA', |
|
26 | + 'standby' => 'Text', |
|
27 | + 'tabindex' => 'Number', |
|
28 | + 'type' => 'ContentType', |
|
29 | + 'width' => 'Length' |
|
30 | + ) |
|
31 | + ); |
|
32 | + |
|
33 | + $this->addElement('param', false, 'Empty', false, |
|
34 | + array( |
|
35 | + 'id' => 'ID', |
|
36 | + 'name*' => 'Text', |
|
37 | + 'type' => 'Text', |
|
38 | + 'value' => 'Text', |
|
39 | + 'valuetype' => 'Enum#data,ref,object' |
|
40 | + ) |
|
41 | + ); |
|
42 | + |
|
43 | + } |
|
44 | 44 | |
45 | 45 | } |
46 | 46 |
@@ -13,23 +13,23 @@ |
||
13 | 13 | class HTMLPurifier_HTMLModule_Presentation extends HTMLPurifier_HTMLModule |
14 | 14 | { |
15 | 15 | |
16 | - public $name = 'Presentation'; |
|
16 | + public $name = 'Presentation'; |
|
17 | 17 | |
18 | - public function setup($config) { |
|
19 | - $this->addElement('hr', 'Block', 'Empty', 'Common'); |
|
20 | - $this->addElement('sub', 'Inline', 'Inline', 'Common'); |
|
21 | - $this->addElement('sup', 'Inline', 'Inline', 'Common'); |
|
22 | - $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); |
|
23 | - $b->formatting = true; |
|
24 | - $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); |
|
25 | - $big->formatting = true; |
|
26 | - $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); |
|
27 | - $i->formatting = true; |
|
28 | - $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); |
|
29 | - $small->formatting = true; |
|
30 | - $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); |
|
31 | - $tt->formatting = true; |
|
32 | - } |
|
18 | + public function setup($config) { |
|
19 | + $this->addElement('hr', 'Block', 'Empty', 'Common'); |
|
20 | + $this->addElement('sub', 'Inline', 'Inline', 'Common'); |
|
21 | + $this->addElement('sup', 'Inline', 'Inline', 'Common'); |
|
22 | + $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); |
|
23 | + $b->formatting = true; |
|
24 | + $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); |
|
25 | + $big->formatting = true; |
|
26 | + $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); |
|
27 | + $i->formatting = true; |
|
28 | + $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); |
|
29 | + $small->formatting = true; |
|
30 | + $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); |
|
31 | + $tt->formatting = true; |
|
32 | + } |
|
33 | 33 | |
34 | 34 | } |
35 | 35 |
@@ -16,18 +16,18 @@ |
||
16 | 16 | public $name = 'Presentation'; |
17 | 17 | |
18 | 18 | public function setup($config) { |
19 | - $this->addElement('hr', 'Block', 'Empty', 'Common'); |
|
20 | - $this->addElement('sub', 'Inline', 'Inline', 'Common'); |
|
21 | - $this->addElement('sup', 'Inline', 'Inline', 'Common'); |
|
22 | - $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); |
|
19 | + $this->addElement('hr', 'Block', 'Empty', 'Common'); |
|
20 | + $this->addElement('sub', 'Inline', 'Inline', 'Common'); |
|
21 | + $this->addElement('sup', 'Inline', 'Inline', 'Common'); |
|
22 | + $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); |
|
23 | 23 | $b->formatting = true; |
24 | - $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); |
|
24 | + $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); |
|
25 | 25 | $big->formatting = true; |
26 | - $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); |
|
26 | + $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); |
|
27 | 27 | $i->formatting = true; |
28 | - $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); |
|
28 | + $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); |
|
29 | 29 | $small->formatting = true; |
30 | - $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); |
|
30 | + $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); |
|
31 | 31 | $tt->formatting = true; |
32 | 32 | } |
33 | 33 |
@@ -7,26 +7,26 @@ |
||
7 | 7 | class HTMLPurifier_HTMLModule_Proprietary extends HTMLPurifier_HTMLModule |
8 | 8 | { |
9 | 9 | |
10 | - public $name = 'Proprietary'; |
|
10 | + public $name = 'Proprietary'; |
|
11 | 11 | |
12 | - public function setup($config) { |
|
12 | + public function setup($config) { |
|
13 | 13 | |
14 | - $this->addElement('marquee', 'Inline', 'Flow', 'Common', |
|
15 | - array( |
|
16 | - 'direction' => 'Enum#left,right,up,down', |
|
17 | - 'behavior' => 'Enum#alternate', |
|
18 | - 'width' => 'Length', |
|
19 | - 'height' => 'Length', |
|
20 | - 'scrolldelay' => 'Number', |
|
21 | - 'scrollamount' => 'Number', |
|
22 | - 'loop' => 'Number', |
|
23 | - 'bgcolor' => 'Color', |
|
24 | - 'hspace' => 'Pixels', |
|
25 | - 'vspace' => 'Pixels', |
|
26 | - ) |
|
27 | - ); |
|
14 | + $this->addElement('marquee', 'Inline', 'Flow', 'Common', |
|
15 | + array( |
|
16 | + 'direction' => 'Enum#left,right,up,down', |
|
17 | + 'behavior' => 'Enum#alternate', |
|
18 | + 'width' => 'Length', |
|
19 | + 'height' => 'Length', |
|
20 | + 'scrolldelay' => 'Number', |
|
21 | + 'scrollamount' => 'Number', |
|
22 | + 'loop' => 'Number', |
|
23 | + 'bgcolor' => 'Color', |
|
24 | + 'hspace' => 'Pixels', |
|
25 | + 'vspace' => 'Pixels', |
|
26 | + ) |
|
27 | + ); |
|
28 | 28 | |
29 | - } |
|
29 | + } |
|
30 | 30 | |
31 | 31 | } |
32 | 32 |
@@ -7,20 +7,20 @@ |
||
7 | 7 | class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule |
8 | 8 | { |
9 | 9 | |
10 | - public $name = 'Ruby'; |
|
10 | + public $name = 'Ruby'; |
|
11 | 11 | |
12 | - public function setup($config) { |
|
13 | - $this->addElement('ruby', 'Inline', |
|
14 | - 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', |
|
15 | - 'Common'); |
|
16 | - $this->addElement('rbc', false, 'Required: rb', 'Common'); |
|
17 | - $this->addElement('rtc', false, 'Required: rt', 'Common'); |
|
18 | - $rb = $this->addElement('rb', false, 'Inline', 'Common'); |
|
19 | - $rb->excludes = array('ruby' => true); |
|
20 | - $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); |
|
21 | - $rt->excludes = array('ruby' => true); |
|
22 | - $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); |
|
23 | - } |
|
12 | + public function setup($config) { |
|
13 | + $this->addElement('ruby', 'Inline', |
|
14 | + 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', |
|
15 | + 'Common'); |
|
16 | + $this->addElement('rbc', false, 'Required: rb', 'Common'); |
|
17 | + $this->addElement('rtc', false, 'Required: rt', 'Common'); |
|
18 | + $rb = $this->addElement('rb', false, 'Inline', 'Common'); |
|
19 | + $rb->excludes = array('ruby' => true); |
|
20 | + $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); |
|
21 | + $rt->excludes = array('ruby' => true); |
|
22 | + $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); |
|
23 | + } |
|
24 | 24 | |
25 | 25 | } |
26 | 26 |
@@ -6,28 +6,28 @@ |
||
6 | 6 | class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule |
7 | 7 | { |
8 | 8 | |
9 | - public $name = 'SafeEmbed'; |
|
9 | + public $name = 'SafeEmbed'; |
|
10 | 10 | |
11 | - public function setup($config) { |
|
11 | + public function setup($config) { |
|
12 | 12 | |
13 | - $max = $config->get('HTML.MaxImgLength'); |
|
14 | - $embed = $this->addElement( |
|
15 | - 'embed', 'Inline', 'Empty', 'Common', |
|
16 | - array( |
|
17 | - 'src*' => 'URI#embedded', |
|
18 | - 'type' => 'Enum#application/x-shockwave-flash', |
|
19 | - 'width' => 'Pixels#' . $max, |
|
20 | - 'height' => 'Pixels#' . $max, |
|
21 | - 'allowscriptaccess' => 'Enum#never', |
|
22 | - 'allownetworking' => 'Enum#internal', |
|
23 | - 'flashvars' => 'Text', |
|
24 | - 'wmode' => 'Enum#window,transparent,opaque', |
|
25 | - 'name' => 'ID', |
|
26 | - ) |
|
27 | - ); |
|
28 | - $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); |
|
13 | + $max = $config->get('HTML.MaxImgLength'); |
|
14 | + $embed = $this->addElement( |
|
15 | + 'embed', 'Inline', 'Empty', 'Common', |
|
16 | + array( |
|
17 | + 'src*' => 'URI#embedded', |
|
18 | + 'type' => 'Enum#application/x-shockwave-flash', |
|
19 | + 'width' => 'Pixels#' . $max, |
|
20 | + 'height' => 'Pixels#' . $max, |
|
21 | + 'allowscriptaccess' => 'Enum#never', |
|
22 | + 'allownetworking' => 'Enum#internal', |
|
23 | + 'flashvars' => 'Text', |
|
24 | + 'wmode' => 'Enum#window,transparent,opaque', |
|
25 | + 'name' => 'ID', |
|
26 | + ) |
|
27 | + ); |
|
28 | + $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); |
|
29 | 29 | |
30 | - } |
|
30 | + } |
|
31 | 31 | |
32 | 32 | } |
33 | 33 |
@@ -16,8 +16,8 @@ |
||
16 | 16 | array( |
17 | 17 | 'src*' => 'URI#embedded', |
18 | 18 | 'type' => 'Enum#application/x-shockwave-flash', |
19 | - 'width' => 'Pixels#' . $max, |
|
20 | - 'height' => 'Pixels#' . $max, |
|
19 | + 'width' => 'Pixels#'.$max, |
|
20 | + 'height' => 'Pixels#'.$max, |
|
21 | 21 | 'allowscriptaccess' => 'Enum#never', |
22 | 22 | 'allownetworking' => 'Enum#internal', |
23 | 23 | 'flashvars' => 'Text', |