From 01c14cdae62e735d7e53a263c11b03de2406103f Mon Sep 17 00:00:00 2001
From: Elke Kreim <elke.kreim@hs-hannover.de>
Date: Wed, 10 Jul 2024 14:45:07 +0200
Subject: [PATCH] Revert "Fix remote url for MathJax"

This reverts commit a55291e2b354642ca9749f4f2dd68c344a5b21e2.
---
 vle_specific.php | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/vle_specific.php b/vle_specific.php
index 516a56f25..24953878d 100644
--- a/vle_specific.php
+++ b/vle_specific.php
@@ -189,27 +189,8 @@ function stack_cors_link(string $filename): string {
  * Gets the URL used for MathJax, might be VLE local.
  */
 function stack_get_mathjax_url(): string {
-    // HSH patch - 2024.05.31: Elke Kreim - elke.kreim@hs-hannover.de
-    // include fix https://github.com/maths/moodle-qtype_stack/pull/1194/files
-    // to use local installation of MathHax configured in plugin filter_mathjaxloader
-    $mathjaxconfigurl = get_config('filter_mathjaxloader', 'httpsurl');
-    if ($mathjaxconfigurl) {
-        $questionpos = strpos($mathjaxconfigurl, '?');
-        if ($questionpos !== false) {
-            $querystring = substr($mathjaxconfigurl, $questionpos + 1);
-            $urlstring = substr($mathjaxconfigurl, 0, $questionpos);
-            parse_str($querystring, $queryparams);
-            $queryparams = array_merge(['config' => 'TeX-AMS-MML_HTMLorMML'], $queryparams);
-            $querystring = http_build_query($queryparams, null, '&', PHP_QUERY_RFC3986);
-            $url = $urlstring . '?' . $querystring;
-        } else {
-            $url = $mathjaxconfigurl . '?config=TeX-AMS-MML_HTMLorMML';
-        }
-
-        return $url;
-    } else {
-        return 'https://cdn.jsdelivr.net/npm/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
-    }
+    // TODO: figure out how to support VLE local with CORS.
+    return 'https://cdn.jsdelivr.net/npm/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
 }
 
 /*
-- 
GitLab