summaryrefslogtreecommitdiff
path: root/modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-03 14:18:45 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-03 14:18:45 -0700
commitf6d847739a9149531d0649bf3d38f9e30078106a (patch)
tree7843c542a6ae5a7005504b1dfbc2689896acdafc /modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php
parent8d5900f63956d6746a78a4bd5ac0c4f8086752bc (diff)
Update the source so the third party code passes the File Structure Test
Diffstat (limited to 'modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php')
-rw-r--r--modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php
new file mode 100644
index 00000000..c7e27afb
--- /dev/null
+++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php
@@ -0,0 +1,21 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+
+class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule
+{
+
+ public $name = 'Name';
+
+ public function setup($config) {
+ $elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map');
+ foreach ($elements as $name) {
+ $element = $this->addBlankElement($name);
+ $element->attr['name'] = 'CDATA';
+ if (!$config->get('HTML.Attr.Name.UseCDATA')) {
+ $element->attr_transform_post['NameSync'] = new HTMLPurifier_AttrTransform_NameSync();
+ }
+ }
+ }
+
+}
+
+// vim: et sw=4 sts=4