diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-16 11:27:04 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-16 11:27:04 +0000 |
commit | 6f1a3d18fc90bdf4ca5dff45214dc8874a1b79a2 (patch) | |
tree | d310c9cd50d7811a4adf2740a298232850d35f40 | |
parent | 8386bc74a480582d4b26660346d43eae2c59b6c6 (diff) | |
download | elgg-6f1a3d18fc90bdf4ca5dff45214dc8874a1b79a2.tar.gz elgg-6f1a3d18fc90bdf4ca5dff45214dc8874a1b79a2.tar.bz2 |
Closes #156 & #139
git-svn-id: https://code.elgg.org/elgg/trunk@1437 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/opendd.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engine/lib/opendd.php b/engine/lib/opendd.php index 7ebd1445b..5f1a3a147 100644 --- a/engine/lib/opendd.php +++ b/engine/lib/opendd.php @@ -209,12 +209,12 @@ foreach ($this->attributes as $k => $v) $attr .= ($v!="") ? "$k=\"$v\" " : ""; - $body = htmlentities($this->getBody(), NULL, 'UTF-8'); + $body = $this->getBody(); $tag = $this->getTagName(); $end = "/>"; if ($body!="") - $end = ">$body</{$tag}>"; + $end = "><![CDATA[$body]]></{$tag}>"; return "<{$tag} $attr" . $end . "\n"; } @@ -310,7 +310,13 @@ $odd->setAttribute($k,$v); // Body - $odd->setBody(html_entity_decode($element->content, NULL, 'UTF-8')); + $body = $element->content; + $a = stripos($body, "<![CDATA"); + $b = strripos($body, "]]>"); + if (($body) && ($a!==false) && ($b!==false)) + $body = substr($body, $a+8, $b-($a+8)); + + $odd->setBody($body); } return $odd; |