Skip to content

Commit

Permalink
fix: replace_qpy_urls regex
Browse files Browse the repository at this point in the history
  • Loading branch information
MHajoha committed Sep 18, 2024
1 parent 79bf9bd commit 7ddafcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/question_ui_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7ddafcf

Please sign in to comment.