From fab36cf442ded76f6ac4e1da4478299971acc2e9 Mon Sep 17 00:00:00 2001 From: Brad Dutton Date: Fri, 19 Aug 2022 14:17:24 -0700 Subject: [PATCH] update file/directory name limits 255 -> 768. Any bigger and the mysql index fails --- modules/gallery/helpers/gallery_installer.php | 16 ++++++++++++---- modules/gallery/module.info | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index f160415039..4a7f246d10 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -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, @@ -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, @@ -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() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 49023e45a2..7c29bf4d73 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -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"