2007-04-30 21:19:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Special-case enum attribute definition that lazy loads allowed frame targets
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef_Enum
|
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @type array
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public $valid_values = false; // uninitialized value
|
2013-07-16 11:56:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @type bool
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
protected $case_sensitive = false;
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param string $string
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @param HTMLPurifier_Context $context
|
|
|
|
* @return bool|string
|
|
|
|
*/
|
|
|
|
public function validate($string, $config, $context)
|
|
|
|
{
|
|
|
|
if ($this->valid_values === false) {
|
|
|
|
$this->valid_values = $config->get('Attr.AllowedFrameTargets');
|
|
|
|
}
|
2007-04-30 21:19:15 +00:00
|
|
|
return parent::validate($string, $config, $context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|