From: skodak <skodak>
Date: Sat, 15 Sep 2007 19:36:31 +0000 (+0000)
Subject: MDL-11295 editorshortcutshelpbutton breaking xhtml strict
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e193724e3885bef295d062df985b4257ebeb015e;p=moodle.git

MDL-11295 editorshortcutshelpbutton breaking xhtml strict
---

diff --git a/lib/weblib.php b/lib/weblib.php
index 219fb95817..3fd2e540c9 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -4327,8 +4327,11 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
 
     if ($usehtmleditor) {
         // Show shortcuts button if HTML editor is in use, but only if JavaScript is enabled (MDL-9556)
-        $str .= '<script type="text/javascript">document.write(\''.
-            str_replace('\'','\\\'',editorshortcutshelpbutton()).'\'); </script>';
+        $str .= '<script type="text/javascript">
+//<![CDATA[
+document.write(\''.addslashes_js(editorshortcutshelpbutton()).'\');
+//]]>
+</script>';
     }
 
     if ($return) {