Skip to content

Commit

Permalink
Add mimetype for ReStructuredText
Browse files Browse the repository at this point in the history
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
  • Loading branch information
kyteinsky committed Nov 30, 2023
1 parent 63b1084 commit 922d529
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/private/Repair/RepairMimeTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ private function introduceEmlAndMsgFormatType() {
return $this->updateMimetypes($updatedMimetypes);
}

private function introduceReStructuredTextFormatType() {
$updatedMimetypes = [
'rst' => 'text/x-rst',
];

return $this->updateMimetypes($updatedMimetypes);
}

/**
* Fix mime types
*/
Expand Down Expand Up @@ -310,5 +318,9 @@ public function run(IOutput $out) {
if (version_compare($ocVersionFromBeforeUpdate, '29.0.0.2', '<') && $this->introduceEmlAndMsgFormatType()) {
$out->info('Fixed eml and msg mime type');
}

if (version_compare($ocVersionFromBeforeUpdate, '29.0.0.3', '<') && $this->introduceReStructuredTextFormatType()) {
$out->info('Fixed ReStructured Text mime type');
}
}
}
1 change: 1 addition & 0 deletions resources/config/mimetypealiases.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"text/x-java-source": "text/code",
"text/x-ldif": "text/code",
"text/x-python": "text/code",
"text/x-rst": "text",
"text/x-shellscript": "text/code",
"web": "text/code",
"application/internet-shortcut": "link",
Expand Down
1 change: 1 addition & 0 deletions resources/config/mimetypemapping.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
"rar": ["application/x-rar-compressed"],
"reveal": ["text/reveal"],
"rss": ["application/rss+xml"],
"rst": ["text/x-rst"],
"rtf": ["text/rtf"],
"rw2": ["image/x-dcraw"],
"schema": ["text/plain"],
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patch level
// when updating major/minor version number.

$OC_Version = [29, 0, 0, 2];
$OC_Version = [29, 0, 0, 3];

// The human-readable string
$OC_VersionString = '29.0.0 dev';
Expand Down

0 comments on commit 922d529

Please sign in to comment.