diff --git a/lib/form/classes/filetypes_util.php b/lib/form/classes/filetypes_util.php index fb74b3f7f56..6dc4c74ea8d 100644 --- a/lib/form/classes/filetypes_util.php +++ b/lib/form/classes/filetypes_util.php @@ -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. diff --git a/lib/tests/messageinbound_test.php b/lib/tests/messageinbound_test.php index ab70d2cb3ea..5b5190f5409 100644 --- a/lib/tests/messageinbound_test.php +++ b/lib/tests/messageinbound_test.php @@ -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, diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index fd687c31e04..f6dc727c323 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -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) { diff --git a/question/type/gapselect/questiontypebase.php b/question/type/gapselect/questiontypebase.php index 0d89c0d8a2c..77ecdb820cd 100644 --- a/question/type/gapselect/questiontypebase.php +++ b/question/type/gapselect/questiontypebase.php @@ -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; diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index d750bfd4e42..52ca37d5f13 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -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)) {