root/afridex/plugins/Flutter/purifier_lib/HTMLPurifier/AttrTransform/Name.php
| Revision 21, 459 bytes (checked in by admin, 18 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Pre-transform that changes deprecated name attribute to ID if necessary |
| 5 | */ |
| 6 | class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform |
| 7 | { |
| 8 | |
| 9 | public function transform($attr, $config, $context) { |
| 10 | if (!isset($attr['name'])) return $attr; |
| 11 | $id = $this->confiscateAttr($attr, 'name'); |
| 12 | if ( isset($attr['id'])) return $attr; |
| 13 | $attr['id'] = $id; |
| 14 | return $attr; |
| 15 | } |
| 16 | |
| 17 | } |
| 18 |
Note: See TracBrowser
for help on using the browser.
