diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php
index 215c9ad4ce..835fec3eb1 100644
--- a/main/inc/global.inc.php
+++ b/main/inc/global.inc.php
@@ -617,3 +617,6 @@ if (empty($default_quota)) {
$default_quota = 100000000;
}
define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
+
+// Sets the ascii_math plugin see #7134
+$_SESSION['ascii_math_loaded'] = false;
diff --git a/main/inc/lib/fckeditor/myconfig.php b/main/inc/lib/fckeditor/myconfig.php
index d8f741cfcd..7a3683cf35 100644
--- a/main/inc/lib/fckeditor/myconfig.php
+++ b/main/inc/lib/fckeditor/myconfig.php
@@ -204,7 +204,7 @@ if ((api_get_setting('enabled_asciisvg') == 'true')) {
if (api_get_setting('include_asciimathml_script') == 'true') {
// The automatic content parsing should be disabled on this case, otherwise content would be damaged.
// The editor does the necessary parsing within its separate iframe.
- echo '';
+ $config['LoadAsciiMath'] = '';
}
// WIRIS: plugin for inserting mathematical formulas
diff --git a/main/inc/lib/formvalidator/Element/html_editor.php b/main/inc/lib/formvalidator/Element/html_editor.php
index d7dde836be..dfc070c55d 100644
--- a/main/inc/lib/formvalidator/Element/html_editor.php
+++ b/main/inc/lib/formvalidator/Element/html_editor.php
@@ -106,10 +106,20 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea {
if (!FCKeditor :: IsCompatible()) {
return parent::toHTML();
}
- $this->fck_editor->Value = $this->getValue();
+ $this->fck_editor->Value = $this->getValue();
$result = $this->fck_editor->CreateHtml();
+
+ if (isset($this->fck_editor->Config['LoadAsciiMath'])) {
+ if (isset($_SESSION['ascii_math_loaded']) &&
+ $_SESSION['ascii_math_loaded'] == false
+ ) {
+ $result .= $this->fck_editor->Config['LoadAsciiMath'];
+ $_SESSION['ascii_math_loaded'] = true;
+ }
+ }
+
//Add a link to open the allowed html tags window
//$result .= 'fullPage ? '1' : '0')."','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600,left=200,top=20'".'); return false;">'.get_lang('AllowedHTMLTags').'';
return $result;
}
-}
\ No newline at end of file
+}