diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2022-11-15 11:48:50 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2022-11-15 12:00:03 +0100 |
commit | 582f07c8fc47d4a775f05fbaad32269753d944f0 (patch) | |
tree | ab93026a29788311d1de3efd35c98d5af40ff264 /lib/private/Repair | |
parent | baf74f0aa1b8947272b10532a3c3a1cff16b6085 (diff) | |
download | nextcloud-server-582f07c8fc47d4a775f05fbaad32269753d944f0.tar.gz nextcloud-server-582f07c8fc47d4a775f05fbaad32269753d944f0.zip |
Add text/asciidoc mimetype
Ref https://docs.asciidoctor.org/asciidoc/latest/faq/#whats-the-media-type-aka-mime-type-for-asciidoc
This is step 1 towards allowing editing of AsciiDoc files in Nextcloud.
Step 2 is adding support in https://github.com/nextcloud/text.
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
Diffstat (limited to 'lib/private/Repair')
-rw-r--r-- | lib/private/Repair/RepairMimeTypes.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 5b216331dc7..5f3531ea79c 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -106,6 +106,15 @@ class RepairMimeTypes implements IRepairStep { return $count; } + private function introduceAsciidocType() { + $updatedMimetypes = [ + 'adoc' => 'text/asciidoc', + 'asciidoc' => 'text/asciidoc', + ]; + + return $this->updateMimetypes($updatedMimetypes); + } + private function introduceImageTypes() { $updatedMimetypes = [ 'jp2' => 'image/jp2', @@ -273,5 +282,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '25.0.0.2', '<') && $this->introduceOnlyofficeFormType()) { $out->info('Fixed ONLYOFFICE Forms OpenXML mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '26.0.0.1', '<') && $this->introduceAsciidocType()) { + $out->info('Fixed AsciiDoc mime types'); + } } } |