diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 3495cf5916..09f467d387 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -46,12 +46,12 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', ' INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method', 'db'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_filesize', '6144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_filesize', '262144'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_gallery_path', 'images/avatars/gallery'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_height', '90'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_width', '90'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_height', '20'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_width', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_height', '120'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_width', '120'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_height', '40'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_width', '40'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_salt', 'phpbb_avatar'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact', 'contact@yourdomain.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact_name', ''); diff --git a/phpBB/phpbb/db/migration/data/v400/increase_avatar_size.php b/phpBB/phpbb/db/migration/data/v400/increase_avatar_size.php new file mode 100644 index 0000000000..c7d4eccd14 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v400/increase_avatar_size.php @@ -0,0 +1,40 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v400; + +use phpbb\db\migration\container_aware_migration; + +class increase_avatar_size extends container_aware_migration +{ + public static function depends_on() + { + return ['\phpbb\db\migration\data\v400\dev']; + } + + public function update_data() + { + return [ + ['custom', [[$this, 'increase_size']]], + ]; + } + + public function increase_size(): void + { + $this->config['avatar_filesize'] = max(262144, $this->config['avatar_filesize']); // Increase to 256 KiB + $this->config['avatar_max_height'] = max('120', $this->config['avatar_max_height']); // Increase to max 120px height + $this->config['avatar_max_width'] = max('120', $this->config['avatar_max_width']); // Increase to max 120px width + $this->config['avatar_min_height'] = max('40', $this->config['avatar_min_height']); // Increase to min 40px height + $this->config['avatar_min_width'] = max('40', $this->config['avatar_min_width']); // Increase to max 40px width + } +}