2011-12-30 14:56:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dummy AttrDef that mimics another AttrDef, BUT it generates clones
|
|
|
|
* with make.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef
|
|
|
|
{
|
|
|
|
/**
|
2013-07-16 11:56:14 +00:00
|
|
|
* What we're cloning.
|
|
|
|
* @type HTMLPurifier_AttrDef
|
2011-12-30 14:56:44 +00:00
|
|
|
*/
|
|
|
|
protected $clone;
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param HTMLPurifier_AttrDef $clone
|
|
|
|
*/
|
|
|
|
public function __construct($clone)
|
|
|
|
{
|
2011-12-30 14:56:44 +00:00
|
|
|
$this->clone = $clone;
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param string $v
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @param HTMLPurifier_Context $context
|
|
|
|
* @return bool|string
|
|
|
|
*/
|
|
|
|
public function validate($v, $config, $context)
|
|
|
|
{
|
2011-12-30 14:56:44 +00:00
|
|
|
return $this->clone->validate($v, $config, $context);
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param string $string
|
|
|
|
* @return HTMLPurifier_AttrDef
|
|
|
|
*/
|
|
|
|
public function make($string)
|
|
|
|
{
|
2011-12-30 14:56:44 +00:00
|
|
|
return clone $this->clone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|