0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 00:41:52 +00:00

[2.1.2] Fix some validation problems in printDefinition.php's output

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1381 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-08-19 15:38:37 +00:00
parent 9881a34712
commit 7827a95273
2 changed files with 10 additions and 5 deletions

View File

@ -25,7 +25,9 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
/** /**
* Whether or not to compress directive names, clipping them off * Whether or not to compress directive names, clipping them off
* after a certain amount of letters * after a certain amount of letters. False to disable or integer letters
* before clipping.
* @protected
*/ */
var $compress = false; var $compress = false;
@ -41,11 +43,13 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
$this->docURL = $doc_url; $this->docURL = $doc_url;
$this->name = $name; $this->name = $name;
$this->compress = $compress; $this->compress = $compress;
// initialize sub-printers
$this->fields['default'] = new HTMLPurifier_Printer_ConfigForm_default(); $this->fields['default'] = new HTMLPurifier_Printer_ConfigForm_default();
$this->fields['bool'] = new HTMLPurifier_Printer_ConfigForm_bool(); $this->fields['bool'] = new HTMLPurifier_Printer_ConfigForm_bool();
} }
/** /**
* Sets default column and row size for textareas in sub-printers
* @param $cols Integer columns of textarea, null to use default * @param $cols Integer columns of textarea, null to use default
* @param $rows Integer rows of textarea, null to use default * @param $rows Integer rows of textarea, null to use default
*/ */
@ -55,15 +59,14 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
} }
/** /**
* Retrieves styling, in case the directory it's in is not publically * Retrieves styling, in case it is not accessible by webserver
* available
*/ */
function getCSS() { function getCSS() {
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css');
} }
/** /**
* Retrieves JavaScript, in case directory is not public * Retrieves JavaScript, in case it is not accessible by webserver
*/ */
function getJavaScript() { function getJavaScript() {
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js');

View File

@ -102,6 +102,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
$ret .= $this->element('td', $this->listifyTagLookup($lookup)); $ret .= $this->element('td', $this->listifyTagLookup($lookup));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->end('table');
return $ret; return $ret;
} }
@ -179,7 +180,8 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
$def->validateChildren(array(), $this->config, $context); $def->validateChildren(array(), $this->config, $context);
} }
$elements = $def->elements; $elements = $def->elements;
} elseif ($def->type == 'chameleon') { }
if ($def->type == 'chameleon') {
$attr['rowspan'] = 2; $attr['rowspan'] = 2;
} elseif ($def->type == 'empty') { } elseif ($def->type == 'empty') {
$elements = array(); $elements = array();