From 7ddafcf5b2116e5e64b8e1ade2f9421cc71d0dd8 Mon Sep 17 00:00:00 2001 From: Maximilian Haye Date: Tue, 3 Sep 2024 16:46:51 +0200 Subject: [PATCH] fix: replace_qpy_urls regex --- classes/question_ui_renderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/question_ui_renderer.php b/classes/question_ui_renderer.php index f1d8c799..99b0a2bb 100644 --- a/classes/question_ui_renderer.php +++ b/classes/question_ui_renderer.php @@ -564,7 +564,7 @@ private function replace_qpy_urls(string $input): string { return preg_replace_callback( // The first two path segments are namespace and short name, and so more restrictive. - ";qpy://static(/(?:[a-z_][a-z0-9_]{1,127}){2}(?:/[\w\-@:%+.~=]+)+);", + ";qpy://static((?:/[a-z_][a-z0-9_]{0,126}){2}(?:/[\w\-@:%+.~=]+)+);", function (array $match) use ($question) { $path = $match[1]; $url = \moodle_url::make_pluginfile_url(