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:
@@ -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.
|
||||
|
||||
--
|
||||
|
||||
|
Reference in New Issue
Block a user