From 1fb9ff333f6afa05fd473978129dc3c91980d711 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Tue, 26 Mar 2024 12:26:58 +0000 Subject: [PATCH] MDL-81359 core_courseformat: Availability 'Show more' unwelcome outing If the availability restriction includes a link, then 'Show more' always appeared even when the entire text is already shown. --- .../classes/output/local/content/section/availability.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course/format/classes/output/local/content/section/availability.php b/course/format/classes/output/local/content/section/availability.php index c3c6bab636c..eb64d159662 100644 --- a/course/format/classes/output/local/content/section/availability.php +++ b/course/format/classes/output/local/content/section/availability.php @@ -209,7 +209,7 @@ class availability implements named_templatable, renderable { $text = info::format_info($availabilityinfo, $course); $data = ['text' => $text]; - if (strlen(html_to_text($text)) > self::AVAILABILITY_EXCERPT_MAXSIZE) { + if (strlen(html_to_text($text, 0, false)) > self::AVAILABILITY_EXCERPT_MAXSIZE) { $data['excerpt'] = shorten_text($text, self::AVAILABILITY_EXCERPT_MAXSIZE); }