mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
Merge branch 'MDL-78632' of https://github.com/marcusboon/moodle
This commit is contained in:
commit
455db24747
@ -313,6 +313,9 @@ abstract class core_filetypes {
|
||||
'xml' => array('type' => 'application/xml', 'icon' => 'markup'),
|
||||
'xsl' => array('type' => 'text/xml', 'icon' => 'markup'),
|
||||
|
||||
'yaml' => array('type' => 'application/yaml', 'icon' => 'markup'),
|
||||
'yml' => array('type' => 'application/yaml', 'icon' => 'markup'),
|
||||
|
||||
'zip' => array('type' => 'application/zip', 'icon' => 'archive', 'groups' => array('archive'), 'string' => 'archive')
|
||||
);
|
||||
}
|
||||
|
@ -3348,5 +3348,27 @@ privatefiles,moodle|/user/files.php';
|
||||
upgrade_main_savepoint(true, 2023062900.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2023072500.00) {
|
||||
// Upgrade yaml mime type for existing yaml and yml files.
|
||||
$filetypes = array(
|
||||
'%.yaml' => 'application/yaml',
|
||||
'%.yml' => 'application/yaml,'
|
||||
);
|
||||
|
||||
$select = $DB->sql_like('filename', '?', false);
|
||||
foreach ($filetypes as $extension => $mimetype) {
|
||||
$DB->set_field_select(
|
||||
'files',
|
||||
'mimetype',
|
||||
$mimetype,
|
||||
$select,
|
||||
array($extension)
|
||||
);
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2023072500.00);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user