1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-03 04:37:39 +02:00

[3.1.0] Remove multi-description functionality as well as file detection.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1525 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-01-27 20:21:31 +00:00
parent 3baf1774b2
commit a74a590f1c
6 changed files with 78 additions and 189 deletions

View File

@@ -11,16 +11,16 @@ class HTMLPurifier_ConfigDef_Directive extends HTMLPurifier_ConfigDef
public function __construct(
$type = null,
$descriptions = null,
$description = null,
$allow_null = null,
$allowed = null,
$aliases = null
) {
if ( $type !== null) $this->type = $type;
if ($descriptions !== null) $this->descriptions = $descriptions;
if ( $allow_null !== null) $this->allow_null = $allow_null;
if ( $allowed !== null) $this->allowed = $allowed;
if ( $aliases !== null) $this->aliases = $aliases;
if ( $type !== null) $this->type = $type;
if ($description !== null) $this->description = $description;
if ( $allow_null !== null) $this->allow_null = $allow_null;
if ( $allowed !== null) $this->allowed = $allowed;
if ( $aliases !== null) $this->aliases = $aliases;
}
/**
@@ -38,10 +38,9 @@ class HTMLPurifier_ConfigDef_Directive extends HTMLPurifier_ConfigDef
public $type = 'mixed';
/**
* Plaintext descriptions of the configuration entity is. Organized by
* file and line number, so multiple descriptions are allowed.
* Plaintext description of the configuration entity is.
*/
public $descriptions = array();
public $description = null;
/**
* Is null allowed? Has no effect for mixed type.
@@ -65,13 +64,5 @@ class HTMLPurifier_ConfigDef_Directive extends HTMLPurifier_ConfigDef
*/
public $directiveAliases = array();
/**
* Adds a description to the array
*/
public function addDescription($file, $line, $description) {
if (!isset($this->descriptions[$file])) $this->descriptions[$file] = array();
$this->descriptions[$file][$line] = $description;
}
}

View File

@@ -135,13 +135,8 @@ class HTMLPurifier_ConfigSchema {
if (isset($this->info[$namespace][$name])) {
// already defined
if (
$this->info[$namespace][$name]->type !== $type ||
$this->defaults[$namespace][$name] !== $default
) {
trigger_error('Inconsistent default or type, cannot redefine');
return;
}
trigger_error('Cannot redefine directive');
return;
} else {
// needs defining
@@ -172,11 +167,7 @@ class HTMLPurifier_ConfigSchema {
$this->defaults[$namespace][$name] = $default;
}
if (!HTMLPURIFIER_SCHEMA_STRICT) return;
// This will be removed soon:
$backtrace = debug_backtrace();
$file = $this->mungeFilename($backtrace[1]['file']);
$line = $backtrace[1]['line'];
$this->info[$namespace][$name]->addDescription($file,$line,$description);
$this->info[$namespace][$name]->description = $description;
}
/** @see HTMLPurifier_ConfigSchema->addNamespace() */