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.
This commit is contained in:
sam marshall 2024-03-26 12:26:58 +00:00
parent 342319339f
commit 1fb9ff333f

View File

@ -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);
}