mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-42582 Availability: Restriction display incorrect for multi-para Labels
When a label has multiple paragraphs, its name (converted to plain text) contains a line feed. Due to an error in regular expressions that don't accept the line feed, this caused incorrect display on the course page when that label is shown as a requirement for accessing another activity.
This commit is contained in:
parent
9524fc754d
commit
597ac7e5d2
@ -909,7 +909,7 @@ abstract class condition_info_base {
|
||||
if (!empty($information)) {
|
||||
$li = strpos($information, '<li>', 4);
|
||||
if ($li === false) {
|
||||
$information = preg_replace('~^<li>(.*)</li>$~', '$1', $information);
|
||||
$information = preg_replace('~^\s*<li>(.*)</li>\s*$~s', '$1', $information);
|
||||
} else {
|
||||
$information = html_writer::tag('ul', $information);
|
||||
}
|
||||
@ -1106,7 +1106,7 @@ abstract class condition_info_base {
|
||||
if (!empty($information)) {
|
||||
$li = strpos($information, '<li>', 4);
|
||||
if ($li === false) {
|
||||
$information = preg_replace('~^<li>(.*)</li>$~', '$1', $information);
|
||||
$information = preg_replace('~^\s*<li>(.*)</li>\s*$~s', '$1', $information);
|
||||
} else {
|
||||
$information = html_writer::tag('ul', $information);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user