comparison InputParser.inc @ 105:b6381903122e

Prevent entity encoding of javascript
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Mon, 07 Mar 2016 17:11:43 +0100
parents 0a33803ee026
children d5f3efba33e2
comparison
equal deleted inserted replaced
104:a5c37e845d7c 105:b6381903122e
75 * Generate an appropriate response for this page, eg. 302 NOT 75 * Generate an appropriate response for this page, eg. 302 NOT
76 * MODIFIED or the actual page 76 * MODIFIED or the actual page
77 */ 77 */
78 function generateContent() 78 function generateContent()
79 { 79 {
80 $retVal = new PageContent($this->master->saveXml($this->master)); 80 //We may need to set and check the contenttype and replace
81 //saveHTML with saveXML
82 $retVal = new PageContent($this->master->saveHTML($this->master));
81 $retVal->setHeader('Content-Language', $this->options->getLang()); 83 $retVal->setHeader('Content-Language', $this->options->getLang());
82 return $retVal; 84 return $retVal;
83 } 85 }
84 86
85 /** 87 /**
88 * @param $param the param tag 90 * @param $param the param tag
89 * 91 *
90 * @return if the type is array, return an array, otherwise return a 92 * @return if the type is array, return an array, otherwise return a
91 * scalar 93 * scalar
92 */ 94 */
93 function getParam($param) 95 static function getParam($param)
94 { 96 {
95 $param_type = $param->getAttribute("type"); 97 $param_type = $param->getAttribute("type");
96 $param_value; 98 $param_value;
97 if (! $param_type) 99 if (! $param_type)
98 $param_type = "scalar"; 100 $param_type = "scalar";
252 $parent = $file->parentNode; 254 $parent = $file->parentNode;
253 foreach ($ndoc->firstChild->childNodes as $child) { 255 foreach ($ndoc->firstChild->childNodes as $child) {
254 $clonedChild = $doc->importNode($child, true); 256 $clonedChild = $doc->importNode($child, true);
255 $parent->insertBefore($clonedChild, $file); 257 $parent->insertBefore($clonedChild, $file);
256 } 258 }
259
257 //We need to iterate in the opposite direction when removing, 260 //We need to iterate in the opposite direction when removing,
258 //so best shifting. 261 //so best shifting.
259 array_unshift($toRemove, $file); 262 array_unshift($toRemove, $file);
260 } 263 }
261 foreach($toRemove as $param) { 264 foreach($toRemove as $param) {
310 $subdoc->load("$subfile"); 313 $subdoc->load("$subfile");
311 $options->getCache()->cache_time($subfile); 314 $options->getCache()->cache_time($subfile);
312 $parent = $include->parentNode; 315 $parent = $include->parentNode;
313 $xml = getElementByTagName($subdoc,"xml"); 316 $xml = getElementByTagName($subdoc,"xml");
314 foreach($xml->childNodes as $child) { 317 foreach($xml->childNodes as $child) {
315 $text = $subdoc->saveXml($child); 318 $text = $subdoc->saveHTML($child);
316 $clonedChild = $doc->importNode($child,true); 319 $clonedChild = $doc->importNode($child,true);
317 $parent->insertBefore($clonedChild,$include); 320 $parent->insertBefore($clonedChild,$include);
318 } 321 }
319 $parent->removeChild($include); 322 $parent->removeChild($include);
320 } 323 }