mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-11 17:20:53 +01:00
20 lines
455 B
PHP
20 lines
455 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Pre-transform that changes deprecated name attribute to ID if necessary
|
||
|
*/
|
||
|
class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform
|
||
|
{
|
||
|
|
||
|
public function transform($attr, $config, $context) {
|
||
|
if (!isset($attr['name'])) return $attr;
|
||
|
$id = $this->confiscateAttr($attr, 'name');
|
||
|
if ( isset($attr['id'])) return $attr;
|
||
|
$attr['id'] = $id;
|
||
|
return $attr;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
// vim: et sw=4 sts=4
|