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

[1.7.0] Convert table module to new format. Add support for literal object $contents variable.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1045 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-05-12 20:26:26 +00:00
parent eaea42f827
commit ed73fdd5b8
4 changed files with 63 additions and 59 deletions

View File

@ -151,6 +151,8 @@ class HTMLPurifier_HTMLModule
$this->info[$element] = HTMLPurifier_ElementDef::create(
$safe, $content_model, $content_model_type, $attr
);
// literal object $contents means direct child manipulation
if (!is_string($contents)) $this->info[$element]->child = $contents;
}
/**
@ -171,8 +173,12 @@ class HTMLPurifier_HTMLModule
* into separate content model and content model type
* @param $contents Allowed children in form of:
* "$content_model_type: $content_model"
* @note If contents is an object, an array of two nulls will be
* returned, and the callee needs to take the original $contents
* and use it directly.
*/
function parseContents($contents) {
if (!is_string($contents)) return array(null, null); // defer
switch ($contents) {
// check for shorthand content model forms
case 'Empty':