From 8d8af19af0fd3560ecbefed9db44649783e79837 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 21 Jun 2023 22:20:03 +0800 Subject: [PATCH] MDL-78542 mod_url: Use the module name for the URL resource's link text --- mod/url/locallib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/url/locallib.php b/mod/url/locallib.php index b3998efae91..02ac7568eba 100644 --- a/mod/url/locallib.php +++ b/mod/url/locallib.php @@ -277,7 +277,7 @@ function url_print_workaround($url, $cm, $course) { } echo '
'; - print_string('clicktoopen', 'url', "$fullurl"); + print_string('clicktoopen', 'url', html_writer::link($fullurl, format_string($cm->name))); echo '
'; echo $OUTPUT->footer(); @@ -289,7 +289,6 @@ function url_print_workaround($url, $cm, $course) { * @param object $url * @param object $cm * @param object $course - * @return does not return */ function url_display_embed($url, $cm, $course) { global $PAGE, $OUTPUT; @@ -298,7 +297,7 @@ function url_display_embed($url, $cm, $course) { $fullurl = url_get_full_url($url, $cm, $course); $title = $url->name; - $link = html_writer::tag('a', $fullurl, array('href'=>str_replace('&', '&', $fullurl))); + $link = html_writer::link($fullurl, format_string($cm->name)); $clicktoopen = get_string('clicktoopen', 'url', $link); $moodleurl = new moodle_url($fullurl);