1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Main: implemented regexp-style validation for complicated child definitions

Also:
* Updated spec with some extra comments
* Trigger error if HTMLDTD_ChildDef_Simple has validateChildren called
* Factor out definition assertion in test class

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@50 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-06-05 00:50:27 +00:00
parent f5486bbbae
commit 4935c69904
3 changed files with 109 additions and 11 deletions

View File

@@ -153,6 +153,8 @@ So... here's the interesting code:
--
// # This actually does the validation
// Validate the order of the children
if (!$was_error && count($dtd_children)) {
$children_list = implode(',', $children);
@@ -166,6 +168,8 @@ if (!$was_error && count($dtd_children)) {
--
// # This figures out the PcreRegex
//$ch is a string of the allowed childs
$children = preg_split('/([^#a-zA-Z0-9_.-]+)/', $ch, -1, PREG_SPLIT_NO_EMPTY);
// check for parsed character data special case
@@ -222,7 +226,8 @@ form
must not contain other form elements.
Normative exclusions straight from the horses mouth. These are SGML style,
not XML style, so we need to modify the ruleset slightly.
not XML style, so we need to modify the ruleset slightly. However, the DTD
may have done this for us already.
--