diff --git a/filter/algebra/algebradebug.php b/filter/algebra/algebradebug.php index 6ae4967107b..c1b04acc824 100644 --- a/filter/algebra/algebradebug.php +++ b/filter/algebra/algebradebug.php @@ -7,6 +7,14 @@ require_once("../../config.php"); + if (empty($CFG->textfilters)) { + error ('Filter not enabled!'); + } else { + $filters = explode(',', $CFG->textfilters); + if (array_search('filter/algebra', $filters) === FALSE) { + error ('Filter not enabled!'); + } + } $CFG->texfilterdir = "filter/tex"; $CFG->algebrafilterdir = "filter/algebra"; diff --git a/filter/algebra/pix.php b/filter/algebra/pix.php index d0218474d86..8fd51bff894 100644 --- a/filter/algebra/pix.php +++ b/filter/algebra/pix.php @@ -6,6 +6,16 @@ $nomoodlecookie = true; // Because it interferes with caching require_once('../../config.php'); + + if (empty($CFG->textfilters)) { + error ('Filter not enabled!'); + } else { + $filters = explode(',', $CFG->textfilters); + if (array_search('filter/algebra', $filters) === FALSE) { + error ('Filter not enabled!'); + } + } + require_once($CFG->libdir.'/filelib.php'); $CFG->texfilterdir = 'filter/tex'; diff --git a/filter/tex/pix.php b/filter/tex/pix.php index 0b79fba73f8..1977c8eb887 100644 --- a/filter/tex/pix.php +++ b/filter/tex/pix.php @@ -6,6 +6,16 @@ $nomoodlecookie = true; // Because it interferes with caching require_once('../../config.php'); + + if (empty($CFG->textfilters)) { + error ('Filter not enabled!'); + } else { + $filters = explode(',', $CFG->textfilters); + if (array_search('filter/tex', $filters) === FALSE) { + error ('Filter not enabled!'); + } + } + require_once($CFG->libdir.'/filelib.php'); require_once('defaultsettings.php' ); require_once('latex.php'); diff --git a/filter/tex/texdebug.php b/filter/tex/texdebug.php index d6e41ae49f2..2db14a7c732 100644 --- a/filter/tex/texdebug.php +++ b/filter/tex/texdebug.php @@ -7,6 +7,15 @@ require_once("../../config.php"); + if (empty($CFG->textfilters)) { + error ('Filter not enabled!'); + } else { + $filters = explode(',', $CFG->textfilters); + if (array_search('filter/tex', $filters) === FALSE) { + error ('Filter not enabled!'); + } + } + $CFG->texfilterdir = "filter/tex"; $CFG->teximagedir = "filter/tex"; diff --git a/filter/tex/texed.php b/filter/tex/texed.php index 5d61b119354..c0069428f46 100644 --- a/filter/tex/texed.php +++ b/filter/tex/texed.php @@ -7,6 +7,15 @@ require_once("../../config.php"); + if (empty($CFG->textfilters)) { + error ('Filter not enabled!'); + } else { + $filters = explode(',', $CFG->textfilters); + if (array_search('filter/tex', $filters) === FALSE) { + error ('Filter not enabled!'); + } + } + $CFG->texfilterdir = "filter/tex"; $CFG->teximagedir = "filter/tex";