From 41e5260a3bd7b3dda5050bd070be05c9910d41ef Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Thu, 13 Apr 2023 16:01:44 +1000 Subject: [PATCH] MDL-76986 editor_tiny: Convert language code format for getting strings --- lib/editor/tiny/lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/editor/tiny/lang.php b/lib/editor/tiny/lang.php index 3608fb757ca..d3a5e988af9 100644 --- a/lib/editor/tiny/lang.php +++ b/lib/editor/tiny/lang.php @@ -81,7 +81,8 @@ class lang { $lang = min_optional_param('lang', 'standard', 'SAFEDIR'); } - $this->lang = $lang; + // Retrieve the correct language by converting to Moodle's language code format. + $this->lang = str_replace('-', '_', $lang); $this->rev = $rev; $this->candidatefile = "{$CFG->localcachedir}/editor_tiny/{$this->rev}/lang/{$this->lang}/lang.json"; }