Merge branch 'MDL-76112-master' of https://github.com/marinaglancy/moodle

This commit is contained in:
Andrew Nicols 2022-11-16 10:07:49 +08:00
commit 7e6d32d7c2
5 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ class filetypes_util {
// Turn string into a list.
if (!is_array($types)) {
$types = preg_split('/[\s,;:"\']+/', $types, null, PREG_SPLIT_NO_EMPTY);
$types = preg_split('/[\s,;:"\']+/', $types, -1, PREG_SPLIT_NO_EMPTY);
}
// Fix whitespace and normalize the syntax a bit.

View File

@ -116,7 +116,7 @@ class messageinbound_test extends \advanced_testcase {
$content = file_get_contents($file->getRealPath());
$content = preg_replace("#\r\n#", "\n", $content);
$tokens = preg_split('#(?:^|\n*)----([A-Z]+)----\n#', $content,
null, PREG_SPLIT_DELIM_CAPTURE);
-1, PREG_SPLIT_DELIM_CAPTURE);
$sections = array(
// Key => Required.
'FULLSOURCE' => true,

View File

@ -453,7 +453,7 @@ class workshop {
}
if (!is_array($extensions)) {
$extensions = preg_split('/[\s,;:"\']+/', $extensions, null, PREG_SPLIT_NO_EMPTY);
$extensions = preg_split('/[\s,;:"\']+/', $extensions, -1, PREG_SPLIT_NO_EMPTY);
}
foreach ($extensions as $i => $extension) {

View File

@ -182,7 +182,7 @@ abstract class qtype_gapselect_base extends question_type {
// Break up the question text, and store the fragments, places and right answers.
$bits = preg_split('/\[\[(\d+)]]/', $question->questiontext,
null, PREG_SPLIT_DELIM_CAPTURE);
-1, PREG_SPLIT_DELIM_CAPTURE);
$question->textfragments[0] = array_shift($bits);
$i = 1;

View File

@ -281,7 +281,7 @@ class qtype_multianswer extends question_type {
parent::initialise_question_instance($question, $questiondata);
$bits = preg_split('/\{#(\d+)\}/', $question->questiontext,
null, PREG_SPLIT_DELIM_CAPTURE);
-1, PREG_SPLIT_DELIM_CAPTURE);
$question->textfragments[0] = array_shift($bits);
$i = 1;
while (!empty($bits)) {