# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1457367103 -3600 # Node ID b6381903122eec68516e2a519e56d59b2dea64a8 # Parent a5c37e845d7cd0ab013b1928856b266630ec1ed2 Prevent entity encoding of javascript diff -r a5c37e845d7c -r b6381903122e InputParser.inc --- a/InputParser.inc Mon Mar 07 17:07:28 2016 +0100 +++ b/InputParser.inc Mon Mar 07 17:11:43 2016 +0100 @@ -77,7 +77,9 @@ */ function generateContent() { - $retVal = new PageContent($this->master->saveXml($this->master)); + //We may need to set and check the contenttype and replace + //saveHTML with saveXML + $retVal = new PageContent($this->master->saveHTML($this->master)); $retVal->setHeader('Content-Language', $this->options->getLang()); return $retVal; } @@ -90,7 +92,7 @@ * @return if the type is array, return an array, otherwise return a * scalar */ - function getParam($param) + static function getParam($param) { $param_type = $param->getAttribute("type"); $param_value; @@ -254,6 +256,7 @@ $clonedChild = $doc->importNode($child, true); $parent->insertBefore($clonedChild, $file); } + //We need to iterate in the opposite direction when removing, //so best shifting. array_unshift($toRemove, $file); @@ -312,7 +315,7 @@ $parent = $include->parentNode; $xml = getElementByTagName($subdoc,"xml"); foreach($xml->childNodes as $child) { - $text = $subdoc->saveXml($child); + $text = $subdoc->saveHTML($child); $clonedChild = $doc->importNode($child,true); $parent->insertBefore($clonedChild,$include); }