aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-27 11:23:19 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-27 11:23:19 +0200
commit4b5bf606cbb60ac4e57088aff518e1e0e745873f (patch)
tree86369a8f137221fd5461f6871527c2a095808608 /apps
parent36f771e9f08ed23c56129b3e47909aef8cda4ab4 (diff)
parent7ee90ddd595ab51d76bd95809dbb1bd997096e10 (diff)
downloadnextcloud-server-4b5bf606cbb60ac4e57088aff518e1e0e745873f.tar.gz
nextcloud-server-4b5bf606cbb60ac4e57088aff518e1e0e745873f.zip
Merge pull request #9215 from owncloud/officemimetypesupdatefix
Office mime types update fix
Diffstat (limited to 'apps')
-rw-r--r--apps/files/appinfo/update.php57
1 files changed, 0 insertions, 57 deletions
diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php
index a9b8ccbf824..de635e5ce6b 100644
--- a/apps/files/appinfo/update.php
+++ b/apps/files/appinfo/update.php
@@ -6,60 +6,3 @@ if (version_compare(\OCP\Config::getSystemValue('version', '0.0.0'), '7.0.0', '<
\OCP\Config::deleteSystemValue('allowZipDownload');
\OCP\Config::deleteSystemValue('maxZipInputSize');
}
-
-if (version_compare(\OCP\Config::getAppValue('files', 'installed_version'), '1.1.9', '<')) {
-
- // update wrong mimetypes
- $wrongMimetypes = array(
- 'application/mspowerpoint' => 'application/vnd.ms-powerpoint',
- 'application/msexcel' => 'application/vnd.ms-excel',
- );
-
- $stmt = OC_DB::prepare('
- UPDATE `*PREFIX*mimetypes`
- SET `mimetype` = ?
- WHERE `mimetype` = ?
- ');
-
- foreach ($wrongMimetypes as $wrong => $correct) {
- OC_DB::executeAudited($stmt, array($wrong, $correct));
- }
-
- $updatedMimetypes = array(
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'xlsx' => 'application/vnd.ms-excel',
- 'pptx' => 'application/vnd.ms-powerpoint',
- );
-
- // separate doc from docx etc
- foreach ($updatedMimetypes as $extension => $mimetype ) {
- $result = OC_DB::executeAudited('
- SELECT count(`mimetype`)
- FROM `*PREFIX*mimetypes`
- WHERE `mimetype` = ?
- ', array($mimetype)
- );
-
- $exists = $result->fetchOne();
-
- if ( ! $exists ) {
- // insert mimetype
- OC_DB::executeAudited('
- INSERT INTO `*PREFIX*mimetypes` ( `mimetype` )
- VALUES ( ? )
- ', array($mimetype)
- );
- }
-
- // change mimetype for files with x extension
- OC_DB::executeAudited('
- UPDATE `*PREFIX*filecache`
- SET `mimetype` = (
- SELECT `id`
- FROM `*PREFIX*mimetypes`
- WHERE `mimetype` = ?
- ) WHERE `name` LIKE ?
- ', array($mimetype, '%.'.$extension)
- );
- }
-} \ No newline at end of file