summaryrefslogtreecommitdiff
path: root/lib/htmloutputter.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-12-04 19:44:45 -0500
committerCraig Andrews <candrews@integralblue.com>2009-12-04 19:44:45 -0500
commit847013db692303cde10f5f161d9fedd787421a37 (patch)
treedc9b63e7fd4c6d3dd36ba303e85f115706c280ac /lib/htmloutputter.php
parent4c8bed8ba0558c5834621331f253e05029fa4e43 (diff)
only write the javascript CDATA blocks if the type is javascript (it's not the correct syntax for other languages)
Diffstat (limited to 'lib/htmloutputter.php')
-rw-r--r--lib/htmloutputter.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index a0066594f..539e356e8 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -367,7 +367,7 @@ class HTMLOutputter extends XMLOutputter
* output a script (almost always javascript) tag with inline
* code.
*
- * @param string $code relative or absolute script path
+ * @param string $code code to put in the script tag
* @param string $type 'type' attribute value of the tag
*
* @return void
@@ -376,9 +376,13 @@ class HTMLOutputter extends XMLOutputter
function inlineScript($code, $type='text/javascript')
{
$this->elementStart('script', array('type' => $type));
- $this->raw('/*<![CDATA[*/ '); // XHTML compat for Safari
+ if($type == 'text/javascript') {
+ $this->raw('/*<![CDATA[*/ '); // XHTML compat
+ }
$this->raw($code);
- $this->raw(' /*]]>*/'); // XHTML compat for Safari
+ if($type == 'text/javascript') {
+ $this->raw(' /*]]>*/'); // XHTML compat
+ }
$this->elementEnd('script');
}