doctypes[$doctype->name] = $doctype;
$name = $doctype->name;
// hookup aliases
foreach ($doctype->aliases as $alias) {
if (isset($this->doctypes[$alias])) {
continue;
}
$this->aliases[$alias] = $name;
}
// remove old aliases
if (isset($this->aliases[$name])) {
unset($this->aliases[$name]);
}
return $doctype;
}
/**
* Retrieves reference to a doctype of a certain name
* @note This function resolves aliases
* @note When possible, use the more fully-featured make()
* @param string $doctype Name of doctype
* @return HTMLPurifier_Doctype Editable doctype object
*/
public function get($doctype)
{
if (isset($this->aliases[$doctype])) {
$doctype = $this->aliases[$doctype];
}
if (!isset($this->doctypes[$doctype])) {
trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR);
$anon = new HTMLPurifier_Doctype($doctype);
return $anon;
}
return $this->doctypes[$doctype];
}
/**
* Creates a doctype based on a configuration object,
* will perform initialization on the doctype
* @note Use this function to get a copy of doctype that config
* can hold on to (this is necessary in order to tell
* Generator whether or not the current document is XML
* based or not).
* @param HTMLPurifier_Config $config
* @return HTMLPurifier_Doctype
*/
public function make($config)
{
return clone $this->get($this->getDoctypeFromConfig($config));
}
/**
* Retrieves the doctype from the configuration object
* @param HTMLPurifier_Config $config
* @return string
*/
public function getDoctypeFromConfig($config)
{
// recommended test
$doctype = $config->get('HTML.Doctype');
if (!empty($doctype)) {
return $doctype;
}
$doctype = $config->get('HTML.CustomDoctype');
if (!empty($doctype)) {
return $doctype;
}
// backwards-compatibility
if ($config->get('HTML.XHTML')) {
$doctype = 'XHTML 1.0';
} else {
$doctype = 'HTML 4.01';
}
if ($config->get('HTML.Strict')) {
$doctype .= ' Strict';
} else {
$doctype .= ' Transitional';
}
return $doctype;
}
}__halt_compiler();----SIGNATURE:----ab5t5tFDhaicJgj8N8xnBB4XEZ6sPb6je6i1sxesHVtNmvrz3UvUtiQvKUu0jrt2oa6XTC08bGzgJth+X/vxFKCvZKBNEdtqiIK83CIzx+D8f6tVeWBV+QN5L77AzGv7DqhtTztUTXjPlcatK4mhrT2RJPMiOkYjP9et7OsbOnKaauDM/kG72OSfshY4dWKP5hZSSGhUeTbJCVIzsMmj11o4iWhtIfAvxHIMzg2Xv3Rp0ntEexk9Ynw0zOJ3k6s2NofjUHoTWS7b1KVodXM8fUqolIJJwrs3ECdT6pYMjOmrRXP9CNCQuWW0XLSZ9jCCZ7LfTVem3RDMM5HyBGfmjVvvkQ6FXfgxOhYVX4pZxnR7f06u3MXQflPirrvNp2w4iYsVEZ/G3F9WTk0gbkoxMoonkAH7D5CbKByl2sqBcnfwVNy1uAKIXfciMlYVKi+GwHg4G/AVpyM65QWK73HdaeTFlH+gJZSVDgo4QkDIVW639A2cZE49zKjf9b6nD2sfIdHGfU/VzQOG9yXaO2fUbAIHMGIlz/d177I+lxFWKbrBwqkZ90ytVsl9wLf3zYUnuzztZw+9gK9dkm/gFLKFYz7qmxM+3kcft557dyie/AtBSdcUZl4s/0maxFqODIU4fAPzQVA1r7u+OrksDUon049QV0MlaWXjw8HESswjeSE=----ATTACHMENT:----MzU5MDY4NTA0MjgwNTk5NCA0Njg1NTI4NjE1Nzk3NTE3IDI5Nzk5OTg3MjEzODI2OTU=