]> git.mjollnir.org Git - moodle.git/commitdiff
Added CDATA to Javascript
authormoodler <moodler>
Fri, 22 Dec 2006 04:19:52 +0000 (04:19 +0000)
committermoodler <moodler>
Fri, 22 Dec 2006 04:19:52 +0000 (04:19 +0000)
blocks/admin_tree/block_admin_tree.php
lib/weblib.php

index 22ae106faf84e3aa97d230e7652df43b3dcc10e8..af544670b727880dc07746e6dccd29c251e7a3ce 100644 (file)
@@ -129,7 +129,7 @@ class block_admin_tree extends block_base {
 
             $this->content = new stdClass;
             $this->content->text  = '<script type="text/javascript">'."\n";
-            $this->content->text .= '<!--' . "\n";
+            $this->content->text .= '//<![CDATA[' . "\n";
             $this->content->text .= 'var vh_numspans = ' . ($this->spancounter - 1) . ';' . "\n";
             $this->content->text .= 'var vh_content = new Array();' . "\n";
             $this->content->text .= 'function getspan(spanid) {' . "\n";
@@ -177,7 +177,7 @@ class block_admin_tree extends block_base {
             $this->content->text .= '  }' . "\n";
             $this->content->text .= '}' . "\n";
 
-            $this->content->text .= '-->' . "\n";
+            $this->content->text .= '//]]>' . "\n";
             $this->content->text .= '</script>' . "\n";
             $this->content->text .= '<div align="left">' . "\n";
 
@@ -185,11 +185,11 @@ class block_admin_tree extends block_base {
 
             $this->content->text .= '</div>' . "\n";
             $this->content->text .= '<script type="text/javascript">' . "\n";
-            $this->content->text .= '<!--' . "\n";
+            $this->content->text .= '//<![CDATA[' . "\n";
             $this->content->text .= 'collapseall();' . "\n";
             $this->content->text .= $this->expandjavascript;
 
-            $this->content->text .= '-->' . "\n";
+            $this->content->text .= '//]]>' . "\n";
             $this->content->text .= '</script>' . "\n";
 
             $searchcontent = isset($CFG->adminsearchquery) ? $CFG->adminsearchquery : '';
index e9aea72d7afa25206f1f329db7f886d4dd59eaa9..58e772b997e55ddd4d78ef75501199c121883dae 100644 (file)
@@ -1016,9 +1016,9 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose
     $output .= '<div id="noscript'.$formname.'" style="display: inline;">';
     $output .= '<input type="submit" value="'.$go.'" /></div>';
     $output .= '<script type="text/javascript">'.
-               "\n<!--\n".
+               "\n//<![CDATA[\n".
                'document.getElementById("noscript'.$formname.'").style.display = "none";'.
-               "\n-->\n".'</script>';
+               "\n//]]>\n".'</script>';
     $output .= '</form>' . "\n";
 
     if ($help) {