Commit 9f6630df authored by Evan Goldenberg's avatar Evan Goldenberg
Browse files

add database upgrade to update the mimetype for files listed as


'application/octet-stream' (bug #520739)
Signed-off-by: default avatarEvan Goldenberg <evangoldenberg@gmail.com>
parent 9fbdedf1
......@@ -1339,6 +1339,15 @@ function xmldb_core_upgrade($oldversion=0) {
set_config('userscanchooseviewthemes', 1);
}
if ($oldversion < 2010012702) {
if ($records = get_records_sql_array("SELECT * FROM {artefact_file_files} WHERE filetype='application/octet-stream'", array())) {
foreach ($records as &$r) {
$path = get_config('dataroot') . 'artefact/file/originals/' . $r->fileid % 256 . '/' . $r->fileid;
set_field('artefact_file_files', 'filetype', mime_content_type($path), 'fileid', $r->fileid);
}
}
}
return $status;
}
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2010012701;
$config->version = 2010012702;
$config->release = '1.3.0dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment