Skip to content

Commit

Permalink
update file/directory name limits 255 -> 768. Any bigger and the mysq…
Browse files Browse the repository at this point in the history
…l index fails
  • Loading branch information
bwdutton committed Aug 19, 2022
1 parent 8733819 commit fab36cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions modules/gallery/helpers/gallery_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ static function install() {
`owner_id` int(9) default NULL,
`parent_id` int(9) NOT NULL,
`rand_key` decimal(11,10) default NULL,
`relative_path_cache` varchar(255) default NULL,
`relative_url_cache` varchar(255) default NULL,
`relative_path_cache` varchar(768) default NULL,
`relative_url_cache` varchar(768) default NULL,
`resize_dirty` boolean default 1,
`resize_height` int(9) default NULL,
`resize_width` int(9) default NULL,
`right_ptr` int(9) NOT NULL,
`slug` varchar(255) default NULL,
`slug` varchar(768) default NULL,
`sort_column` varchar(64) default NULL,
`sort_order` char(4) default 'ASC',
`thumb_dirty` boolean default 1,
Expand All @@ -125,7 +125,7 @@ static function install() {
`category` varchar(64) default NULL,
`html` varchar(255) default NULL,
`message` text default NULL,
`referer` varchar(255) default NULL,
`referer` varchar(5000) default NULL,
`severity` int(9) default 0,
`timestamp` int(9) default 0,
`url` varchar(255) default NULL,
Expand Down Expand Up @@ -829,6 +829,14 @@ static function upgrade($version) {
}
module::set_version("gallery", $version = 58);
}

if ($version == 58) {
$db->query("ALTER TABLE {items} MODIFY COLUMN `relative_path_cache` varchar(768)");
$db->query("ALTER TABLE {items} MODIFY COLUMN `relative_url_cache` varchar(768)");
$db->query("ALTER TABLE {items} MODIFY COLUMN `slug` varchar(768)");
$db->query("ALTER TABLE {logs} MODIFY COLUMN `referer` varchar(5000)");
module::set_version("gallery", $version = 59);
}
}

static function uninstall() {
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/module.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Gallery 3"
description = "Gallery core application"
version = 58
version = 59
author_name = "Gallery Team"
author_url = "http://codex.galleryproject.org/Gallery:Team"
info_url = "http://codex.galleryproject.org/Gallery3:Modules:gallery"
Expand Down

0 comments on commit fab36cf

Please sign in to comment.