summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_installer.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/gallery_installer.php')
-rw-r--r--modules/gallery/helpers/gallery_installer.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 99bc3726..1f190800 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -314,7 +314,7 @@ class gallery_installer {
module::set_var("gallery", "timezone", null);
module::set_var("gallery", "lock_timeout", 1);
- module::set_version("gallery", 51);
+ module::set_version("gallery", 52);
}
static function upgrade($version) {
@@ -688,7 +688,7 @@ class gallery_installer {
if ($version == 47 || $version == 48) {
// Add configuration variable to set timezone. Defaults to the currently
- // used timezone (from PHP configuration). Note that in v48 we werew
+ // used timezone (from PHP configuration). Note that in v48 we were
// setting this value incorrectly, so we're going to stomp this value for v49.
module::set_var("gallery", "timezone", null);
module::set_version("gallery", $version = 49);
@@ -716,12 +716,25 @@ class gallery_installer {
}
if ($version == 50) {
- // In v50, a lock_timeout variable was added so that administrators could edit the time out
+ // In v51, we added a lock_timeout variable so that administrators could edit the time out
// from 1 second to a higher variable if their system runs concurrent parallel uploads for
// instance.
module::set_var("gallery", "lock_timeout", 1);
module::set_version("gallery", $version = 51);
}
+
+ if ($version == 51) {
+ // In v52, we added functions to the legal_file helper that map photo and movie file
+ // extensions to their mime types (and allow extension of the list by other modules). During
+ // this process, we correctly mapped m4v files to video/x-m4v, correcting a previous error
+ // where they were mapped to video/mp4. This corrects the existing items.
+ db::build()
+ ->update("items")
+ ->set("mime_type", "video/x-m4v")
+ ->where("name", "REGEXP", "\.m4v$") // case insensitive since name column is utf8_general_ci
+ ->execute();
+ module::set_version("gallery", $version = 52);
+ }
}
static function uninstall() {