From 678ca5dcdc27f2df10c6042ce74d08f4196d5a02 Mon Sep 17 00:00:00 2001 From: Saeed Hubaishan Date: Sun, 29 Nov 2015 10:51:19 +0300 Subject: [PATCH] [ticket/13180] Increase dateformat field size [ticket/13180] Increase dateformat field size change field size to 64 in these files add new migration file to update the database schema PHPBB3-13180 --- phpBB/adm/style/acp_users_prefs.html | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/ucp/ucp_prefs.php | 2 +- .../data/v31x/increase_size_of_dateformat.php | 36 +++++++++++++++++++ .../template/ucp_prefs_personal.html | 2 +- .../template/ucp_prefs_personal.html | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index 14715f59e4..61904adc23 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -52,7 +52,7 @@

{L_BOARD_DATE_FORMAT_EXPLAIN}
-
style="display:none;">
+
style="display:none;">
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index aa4470fd0e..4c94b99b0d 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1587,7 +1587,7 @@ class acp_users if ($submit) { $error = validate_data($data, array( - 'dateformat' => array('string', false, 1, 30), + 'dateformat' => array('string', false, 1, 64), 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 'tz' => array('timezone'), diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 3c274b53c7..4516525bdf 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -86,7 +86,7 @@ class ucp_prefs } $error = array_merge(validate_data($data, array( - 'dateformat' => array('string', false, 1, 30), + 'dateformat' => array('string', false, 1, 64), 'lang' => array('language_iso_name'), 'tz' => array('timezone'), )), $error); diff --git a/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php new file mode 100644 index 0000000000..d2dfeff728 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php @@ -0,0 +1,36 @@ + +* @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\v31x; + +class increase_size_of_dateformat extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v316', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_dateformat' => array('VCHAR:64', 'd M Y H:i'), + ), + ), + ); + } + +} diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html index c8b028f83a..4cd9f6655b 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -70,7 +70,7 @@ {S_DATEFORMAT_OPTIONS} - + diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html index 1c76e3226d..0dd50b8fa2 100644 --- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html +++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html @@ -59,7 +59,7 @@ -
style="display:none;">
+
style="display:none;">