From 7d627650cba3accfb5d498dd949facca415c6e89 Mon Sep 17 00:00:00 2001 From: Chris Chabot Date: Tue, 14 Apr 2009 11:03:02 +0000 Subject: [PATCH] improper escaping of &'s in javascript assigned by nodeValue caused &&'s to become &'s and break all our if's :) git-svn-id: https://svn.apache.org/repos/asf/incubator/shindig/trunk@764736 13f79535-47bb-0310-9956-ffa450edef68 --- php/src/gadgets/render/GadgetHtmlRenderer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/src/gadgets/render/GadgetHtmlRenderer.php b/php/src/gadgets/render/GadgetHtmlRenderer.php index 562e57a0..c6391962 100644 --- a/php/src/gadgets/render/GadgetHtmlRenderer.php +++ b/php/src/gadgets/render/GadgetHtmlRenderer.php @@ -111,7 +111,8 @@ class GadgetHtmlRenderer extends GadgetRenderer { $script .= $this->appendPreloads($this->gadget); $scriptNode = $doc->createElement('script'); - $scriptNode->nodeValue = $script; + $scriptNode->setAttribute('type', 'text/javascript'); + $scriptNode->nodeValue = str_replace('&', '&', $script); $node->appendChild($scriptNode); } -- 2.11.4.GIT