mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-71343 core_h5p: Convert all line-endings to UNIX format
This commit is contained in:
parent
4ff86720bf
commit
7596e27989
@ -409,6 +409,8 @@ class helper {
|
||||
* @return array The JS array converted to PHP array.
|
||||
*/
|
||||
public static function parse_js_array(string $jscontent): array {
|
||||
// Convert all line-endings to UNIX format first.
|
||||
$jscontent = str_replace(array("\r\n", "\r"), "\n", $jscontent);
|
||||
$jsarray = preg_split('/,\n\s+/', substr($jscontent, 0, -1));
|
||||
$jsarray = preg_replace('~{?\\n~', '', $jsarray);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user