summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery.php9
-rw-r--r--modules/gallery/helpers/gallery_event.php4
-rw-r--r--modules/gallery/helpers/gallery_installer.php11
-rw-r--r--modules/gallery/helpers/module.php2
4 files changed, 17 insertions, 9 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 69aabc4f..282289b5 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -153,8 +153,15 @@ class gallery_Core {
if (is_string($file_name)) {
// make relative to DOCROOT
$parts = explode("/", $file_name);
+ $count = count($parts);
foreach ($parts as $idx => $part) {
- if (in_array($part, array("application", "modules", "themes", "lib"))) {
+ // If this part is "modules" or "themes" make sure that the part 2 after this
+ // is the target directory, and if it is then we're done. This check makes
+ // sure that if Gallery is installed in a directory called "modules" or "themes"
+ // We don't parse the directory structure incorrectly.
+ if (in_array($part, array("modules", "themes")) &&
+ $idx + 2 < $count &&
+ $parts[$idx + 2] == $directory) {
break;
}
unset($parts[$idx]);
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 689e21d1..13a0bdb4 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -178,10 +178,6 @@ class gallery_event_Core {
}
Session::instance()->set("active_auth_timestamp", time());
auth::clear_failed_attempts($user);
-
- if ($user->admin && ini_get("session.use_trans_sid")) {
- message::info(t("PHP is configured with <a href=\"url\">session.use_trans_sid</a> enabled which will cause random logouts. Please disable this setting.", array("url" => "http://www.php.net/manual/en/session.configuration.php#ini.session.use-trans-sid")));
- }
}
static function user_auth_failed($name) {
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index cb314527..f7b8da5f 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -44,7 +44,7 @@ class gallery_installer {
`expiration` int(9) NOT NULL,
`cache` longblob,
PRIMARY KEY (`id`),
- KEY (`key`),
+ UNIQUE KEY (`key`),
KEY (`tags`))
DEFAULT CHARSET=utf8;");
@@ -84,7 +84,7 @@ class gallery_installer {
`album_cover_item_id` int(9) default NULL,
`captured` int(9) default NULL,
`created` int(9) default NULL,
- `description` varchar(2048) default NULL,
+ `description` text default NULL,
`height` int(9) default NULL,
`left_ptr` int(9) NOT NULL,
`level` int(9) NOT NULL,
@@ -309,7 +309,7 @@ class gallery_installer {
module::set_var("gallery", "show_user_profiles_to", "registered_users");
module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin");
- module::set_version("gallery", 42);
+ module::set_version("gallery", 43);
}
static function upgrade($version) {
@@ -648,6 +648,11 @@ class gallery_installer {
$db->query("ALTER TABLE {caches} DROP INDEX `key`, ADD UNIQUE `key` (`key`)");
module::set_version("gallery", $version = 42);
}
+
+ if ($version == 42) {
+ $db->query("ALTER TABLE {items} CHANGE `description` `description` text DEFAULT NULL");
+ module::set_version("gallery", $version = 43);
+ }
}
static function uninstall() {
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 7c5578af..6efe6162 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -168,7 +168,7 @@ class module_Core {
if (method_exists($installer_class, "install")) {
call_user_func_array(array($installer_class, "install"), array());
} else {
- module::set_version($module_name, 1);
+ module::set_version($module_name, module::available()->$module_name->code_version);
}
// Set the weight of the new module, which controls the order in which the modules are