From 9668ac1e386ac849cc9267cf0bc83a5774b10195 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 8 Nov 2006 00:11:10 +0000 Subject: [PATCH] [1.2.0] Add protection against stdclasses into HTMLDefinition. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@514 48356398-32a2-884e-a903-53898d9a118a --- library/HTMLPurifier/HTMLDefinition.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/HTMLPurifier/HTMLDefinition.php b/library/HTMLPurifier/HTMLDefinition.php index 7632bfc1..8914ad70 100644 --- a/library/HTMLPurifier/HTMLDefinition.php +++ b/library/HTMLPurifier/HTMLDefinition.php @@ -397,6 +397,13 @@ class HTMLPurifier_HTMLDefinition $this->info_attr_transform_post[] = new HTMLPurifier_AttrTransform_Lang(); + // protect against stdclasses floating around + foreach ($this->info as $key => $obj) { + if (is_a($obj, 'stdclass')) { + unset($this->info[$key]); + } + } + } function setAttrForTableElements($attr, $def) {