diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-10-02 15:28:03 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-10-02 16:06:56 +0200 |
commit | c80dd82fe4c197cb09344a2ce25f790cd597b792 (patch) | |
tree | c174878a794f790ee40be0a68eb6af5e510e49ff /lib | |
parent | 57ceee13a964ac949717891e13af1990779ad841 (diff) | |
download | nextcloud-server-c80dd82fe4c197cb09344a2ce25f790cd597b792.tar.gz nextcloud-server-c80dd82fe4c197cb09344a2ce25f790cd597b792.zip |
Added mimetype repair step
* Version number increased
Diffstat (limited to 'lib')
-rw-r--r-- | lib/repair/repairmimetypes.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/repair/repairmimetypes.php b/lib/repair/repairmimetypes.php index db11f526ad6..b9cd42f3136 100644 --- a/lib/repair/repairmimetypes.php +++ b/lib/repair/repairmimetypes.php @@ -250,6 +250,39 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep { self::updateMimetypes($updatedMimetypes); } + private function introduceJavaMimeType() { + $updatedMimetypes = array( + 'class' => 'application/java', + 'java' => 'text/x-java-source', + ); + + self::updateMimetypes($updatedMimetypes); + } + + private function introduceHppMimeType() { + $updatedMimetypes = array( + 'hpp' => 'text/x-h', + ); + + self::updateMimetypes($updatedMimetypes); + } + + private function introduceRssMimeType() { + $updatedMimetypes = array( + 'rss' => 'application/rss+xml', + ); + + self::updateMimetypes($updatedMimetypes); + } + + private function introduceRtfMimeType() { + $updatedMimetypes = array( + 'rtf' => 'text/rtf', + ); + + self::updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -294,5 +327,24 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep { $this->emit('\OC\Repair', 'info', array('Fixed Yaml/Yml mime types')); } } + + // Mimetype updates from #19272 + if (version_compare($ocVersionFromBeforeUpdate, '8.2.0.8', '<')) { + if ($this->introduceJavaMimeType()) { + $this->emit('\OC\Repair', 'info', array('Fixed java/class mime types')); + } + + if ($this->introduceHppMimeType()) { + $this->emit('\OC\Repair', 'info', array('Fixed hpp mime type')); + } + + if ($this->introduceRssMimeType()) { + $this->emit('\OC\Repair', 'info', array('Fixed rss mime type')); + } + + if ($this->introduceRtfMimeType()) { + $this->emit('\OC\Repair', 'info', array('Fixed rtf mime type')); + } + } } } |