aboutsummaryrefslogtreecommitdiffstats
path: root/library/HTMLPurifier/AttrTransform/NameSync.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-05-31 09:56:35 +0200
committerMario Vavti <mario@mariovavti.com>2017-05-31 09:56:35 +0200
commit47d55694a4c84b6c12c0db61a69bcac8b671b20e (patch)
treeb15e96f4ea67e2214a66a9d28dafaf53d25b98ec /library/HTMLPurifier/AttrTransform/NameSync.php
parent087f9784e3c5a860ed2b86e7f9e8e9f312038546 (diff)
parentf0e615dee529e031663576286345141ad2996974 (diff)
downloadvolse-hubzilla-2.4.tar.gz
volse-hubzilla-2.4.tar.bz2
volse-hubzilla-2.4.zip
Merge branch '2.4RC'2.4
Diffstat (limited to 'library/HTMLPurifier/AttrTransform/NameSync.php')
-rw-r--r--library/HTMLPurifier/AttrTransform/NameSync.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/library/HTMLPurifier/AttrTransform/NameSync.php b/library/HTMLPurifier/AttrTransform/NameSync.php
deleted file mode 100644
index 36079b786..000000000
--- a/library/HTMLPurifier/AttrTransform/NameSync.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/**
- * Post-transform that performs validation to the name attribute; if
- * it is present with an equivalent id attribute, it is passed through;
- * otherwise validation is performed.
- */
-class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform
-{
-
- public function __construct()
- {
- $this->idDef = new HTMLPurifier_AttrDef_HTML_ID();
- }
-
- /**
- * @param array $attr
- * @param HTMLPurifier_Config $config
- * @param HTMLPurifier_Context $context
- * @return array
- */
- public function transform($attr, $config, $context)
- {
- if (!isset($attr['name'])) {
- return $attr;
- }
- $name = $attr['name'];
- if (isset($attr['id']) && $attr['id'] === $name) {
- return $attr;
- }
- $result = $this->idDef->validate($name, $config, $context);
- if ($result === false) {
- unset($attr['name']);
- } else {
- $attr['name'] = $result;
- }
- return $attr;
- }
-}
-
-// vim: et sw=4 sts=4