From fb34cbf7cde2e7413c0a45dc42e5014c82794b77 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sun, 16 Nov 2014 16:57:07 -0800 Subject: [ticket/13342] Fix invalid resetting of CAPTCHA plugin when using Recaptcha. The Recaptcha plugin class name does not follow the phpbb_captcha_ prefix convention as all others. Instead it simply uses phpbb_, hence the check for its existence under phpbb/captcha/plugins/ fails. PHPBB3-13342 --- phpBB/phpbb/db/migration/data/v310/captcha_plugins.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php b/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php index 13071e9891..328c08f1ec 100644 --- a/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php +++ b/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php @@ -25,9 +25,13 @@ class captcha_plugins extends \phpbb\db\migration\migration public function update_data() { $captcha_plugin = $this->config['captcha_plugin']; - if (strpos($this->config['captcha_plugin'], 'phpbb_captcha_') === 0) + if (strpos($captcha_plugin, 'phpbb_captcha_') === 0) { - $captcha_plugin = substr($this->config['captcha_plugin'], strlen('phpbb_captcha_')); + $captcha_plugin = substr($captcha_plugin, strlen('phpbb_captcha_')); + } + else if (strpos($captcha_plugin, 'phpbb_') === 0) + { + $captcha_plugin = substr($captcha_plugin, strlen('phpbb_')); } return array( -- cgit v1.2.1 From 7b33018ade25a6bb866b7746b9dcc7455a7304ab Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sun, 16 Nov 2014 16:52:59 -0800 Subject: [ticket/13315] Fix loss of CAPTCHA plugin config value. The plugins were moved to phpbb/captcha/plugins/ after this migration was created, thus the check is no longer valid and ends up resetting the value prematurely. PHPBB3-13315 --- phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php index d5f9076196..68d630b063 100644 --- a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php +++ b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php @@ -29,7 +29,8 @@ class reset_missing_captcha_plugin extends \phpbb\db\migration\migration { return array( array('if', array( - (!is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)), + (!is_dir($this->phpbb_root_path . 'phpbb/captcha/plugins/') && + !is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)), array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')), )), ); -- cgit v1.2.1 From 7c6896415391dc94c83486921118edc41189d760 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 18 Nov 2014 00:37:07 -0800 Subject: [ticket/13315] Check for the includes/captcha/plugins/ directory instead. PHPBB3-13315 --- phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php index 68d630b063..8211457dc6 100644 --- a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php +++ b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php @@ -29,7 +29,7 @@ class reset_missing_captcha_plugin extends \phpbb\db\migration\migration { return array( array('if', array( - (!is_dir($this->phpbb_root_path . 'phpbb/captcha/plugins/') && + (is_dir($this->phpbb_root_path . 'includes/captcha/plugins/') && !is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)), array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')), )), -- cgit v1.2.1 From dcd0f200d60d90e17da44a4a0f816b3a37cc3f98 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 22 Nov 2014 19:25:27 +0100 Subject: [prep-release-3.1.2] Add migration for 3.1.2-RC1 --- phpBB/phpbb/db/migration/data/v31x/v312rc1.php | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v312rc1.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/v312rc1.php b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php new file mode 100644 index 0000000000..d4b133fc01 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php @@ -0,0 +1,32 @@ + +* @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 v312rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v311', + '\phpbb\db\migration\data\v31x\m_softdelete_global', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.2-RC1')), + ); + } +} -- cgit v1.2.1 From 0fbe8e8e69729efd6c842bb167faa714d4cd8d35 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 24 Nov 2014 21:32:17 +0100 Subject: [prep-release-3.1.2] Add migration to update version to 3.1.2 --- phpBB/phpbb/db/migration/data/v31x/v312.php | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v312.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/v312.php b/phpBB/phpbb/db/migration/data/v31x/v312.php new file mode 100644 index 0000000000..12a3ec3ae6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v312.php @@ -0,0 +1,31 @@ + + * @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 v312 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v312rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.2')), + ); + } +} -- cgit v1.2.1 From eb83bd5797d3fb7e6c1380b5ecaa2d0a2e69dd82 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 25 Nov 2014 22:42:52 +0100 Subject: [ticket/13381] Fix header intendation of v312.php PHPBB3-13381 --- phpBB/phpbb/db/migration/data/v31x/v312.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/v312.php b/phpBB/phpbb/db/migration/data/v31x/v312.php index 12a3ec3ae6..bf49935f4d 100644 --- a/phpBB/phpbb/db/migration/data/v31x/v312.php +++ b/phpBB/phpbb/db/migration/data/v31x/v312.php @@ -1,15 +1,15 @@ - * @license GNU General Public License, version 2 (GPL-2.0) - * - * For full copyright and license information, please see - * the docs/CREDITS.txt file. - * - */ +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited +* @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; -- cgit v1.2.1 From 1145af71bf08519b389ab57600d855689664ecfc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 22 Nov 2014 11:56:21 +0100 Subject: [ticket/12866] Update existing profile fields with the new validation PHPBB3-12866 --- .../profilefield_remove_underscore_from_alpha.php | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php new file mode 100644 index 0000000000..1f25d239a6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php @@ -0,0 +1,47 @@ + + * @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 profilefield_remove_underscore_from_alpha extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v311'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'remove_underscore_from_alpha_validations'))), + ); + } + + public function remove_underscore_from_alpha_validations() + { + $this->update_validation_rule('[\w]+', '[a-zA-Z0-9]+'); + $this->update_validation_rule('[\w_]+', '[\w]+'); + $this->update_validation_rule('[\w.]+', '[a-zA-Z0-9.]+'); + $this->update_validation_rule('[\w\x20_+\-\[\]]+', '[\w\x20+\-\[\]]+'); + $this->update_validation_rule('[a-zA-Z][\w\.,\-_]+', '[a-zA-Z][\w\.,\-]+'); + } + + public function update_validation_rule($old_validation, $new_validation) + { + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " + SET field_validation = '" . $this->db->sql_escpape($new_validation) . "' + WHERE field_validation = '" . $this->db->sql_escpape($old_validation) . "'"; + $this->db->sql_query($sql); + } +} -- cgit v1.2.1 From aab98b8626d92fdb1000f246a7de5d9c73ebd579 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Nov 2014 20:13:49 +0100 Subject: [ticket/13238] Do not drop indexes that do not exist from fulltext search PHPBB3-13238 --- .../db/migration/data/v310/mysql_fulltext_drop.php | 41 ++++++++++++++++++---- .../migration/data/v310/postgres_fulltext_drop.php | 41 ++++++++++++++++++---- 2 files changed, 70 insertions(+), 12 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php index 4530ebe285..e04a705c91 100644 --- a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php +++ b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php @@ -15,10 +15,18 @@ namespace phpbb\db\migration\data\v310; class mysql_fulltext_drop extends \phpbb\db\migration\migration { + protected $indexes; + public function effectively_installed() { // This migration is irrelevant for all non-MySQL DBMSes. - return strpos($this->db->get_sql_layer(), 'mysql') === false; + if (strpos($this->db->get_sql_layer(), 'mysql') === false) + { + return true; + } + + $this->find_indexes_to_drop(); + return empty($this->indexes); } static public function depends_on() @@ -30,6 +38,11 @@ class mysql_fulltext_drop extends \phpbb\db\migration\migration public function update_schema() { + if (empty($this->indexes)) + { + return array(); + } + /* * Drop FULLTEXT indexes related to MySQL fulltext search. * Doing so is equivalent to dropping the search index from the ACP. @@ -40,12 +53,28 @@ class mysql_fulltext_drop extends \phpbb\db\migration\migration */ return array( 'drop_keys' => array( - $this->table_prefix . 'posts' => array( - 'post_subject', - 'post_text', - 'post_content', - ), + $this->table_prefix . 'posts' => $this->indexes, ), ); } + + public function find_indexes_to_drop() + { + if ($this->indexes !== null) + { + return $this->indexes; + } + + $this->indexes = array(); + $potential_keys = array('post_subject', 'post_text', 'post_content'); + foreach ($potential_keys as $key) + { + if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key)) + { + $this->indexes[] = $key; + } + } + + return $this->indexes; + } } diff --git a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php index ea442dfb1b..3457c19478 100644 --- a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php +++ b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php @@ -15,10 +15,18 @@ namespace phpbb\db\migration\data\v310; class postgres_fulltext_drop extends \phpbb\db\migration\migration { + protected $indexes; + public function effectively_installed() { // This migration is irrelevant for all non-PostgreSQL DBMSes. - return strpos($this->db->get_sql_layer(), 'postgres') === false; + if (strpos($this->db->get_sql_layer(), 'postgres') === false) + { + return true; + } + + $this->find_indexes_to_drop(); + return empty($this->indexes); } static public function depends_on() @@ -30,6 +38,11 @@ class postgres_fulltext_drop extends \phpbb\db\migration\migration public function update_schema() { + if (empty($this->indexes)) + { + return array(); + } + /* * Drop FULLTEXT indexes related to PostgreSQL fulltext search. * Doing so is equivalent to dropping the search index from the ACP. @@ -40,12 +53,28 @@ class postgres_fulltext_drop extends \phpbb\db\migration\migration */ return array( 'drop_keys' => array( - $this->table_prefix . 'posts' => array( - 'post_subject', - 'post_text', - 'post_content', - ), + $this->table_prefix . 'posts' => $this->indexes, ), ); } + + public function find_indexes_to_drop() + { + if ($this->indexes !== null) + { + return $this->indexes; + } + + $this->indexes = array(); + $potential_keys = array('post_subject', 'post_text', 'post_content'); + foreach ($potential_keys as $key) + { + if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key)) + { + $this->indexes[] = $key; + } + } + + return $this->indexes; + } } -- cgit v1.2.1 From 499c1467df41bad32d61032b0af33056e4d34a32 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 30 Nov 2014 11:27:47 +0700 Subject: [ticket/13405] Fix a typo in phpbb/migration/data/v310/style_update_p1.php PHPBB3-13405 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index 5a3a1d5de7..e8d3a3af64 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -92,7 +92,7 @@ class style_update_p1 extends \phpbb\db\migration\migration else { $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id - FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "stles_theme c + FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "styles_theme c WHERE t.template_id = s.template_id AND c.theme_id = s.theme_id"; } -- cgit v1.2.1 From 2f92bc38e6ca81e64f0846b97df2b13310721453 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 30 Nov 2014 16:52:36 +0700 Subject: [ticket/13406] Add a space between the index name and columns list Currently there's no space between the index name and columns list when generating ADD INDEX sql query for MySQL DBMSes. This may cause errors on earlier MySQL versions like 3.23. PHPBB3-13406 --- phpBB/phpbb/db/tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index c8d25f23a2..f523b39fb3 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -2175,7 +2175,7 @@ class tools } // no break case 'mysql_41': - $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . '(' . implode(', ', $column) . ')'; + $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . ' (' . implode(', ', $column) . ')'; break; case 'mssql': -- cgit v1.2.1 From 54b5ee580627e0515f867bdfa2854d862ff06d62 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 9 Dec 2014 18:50:29 -0800 Subject: [ticket/13366] Ensure plupload_last_gc config entry is dynamic. PHPBB3-13366 --- .../data/v31x/plupload_last_gc_dynamic.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php b/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php new file mode 100644 index 0000000000..0783d707c5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php @@ -0,0 +1,31 @@ + +* @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 plupload_last_gc_dynamic extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v312'); + } + + public function update_data() + { + return array( + // Make plupload_last_gc dynamic. + array('config.remove', array('plupload_last_gc')), + array('config.add', array('plupload_last_gc', 0, 1)), + ); + } +} -- cgit v1.2.1 From 6463354a397f16378e36bfbb9d72f915dedaab9d Mon Sep 17 00:00:00 2001 From: n-aleha Date: Thu, 11 Dec 2014 23:52:56 +0200 Subject: [ticket/13098] Repair Yahoo contact field Update the Yahoo link of the yahoo profile field. PHPBB3-13098 --- .../data/v31x/profilefield_yahoo_update_url.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php new file mode 100644 index 0000000000..4df9083bdf --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php @@ -0,0 +1,38 @@ + +* @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 profilefield_yahoo_update_url extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v312'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_contact_url'))), + ); + } + + public function update_contact_url() + { + $sql = 'UPDATE ' . $this->table_prefix . "profile_fields + SET field_contact_url = 'ymsgr:sendim?%s' + WHERE field_name = 'phpbb_yahoo' + AND field_contact_url = 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg'"; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From 9d9c57f33441606f9eceb3f1d983de879c8c3c85 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 9 Jan 2015 13:47:36 +0100 Subject: [ticket/13432] Make sure to add language file when including acp_modules PHPBB3-13432 --- phpBB/phpbb/db/migration/tool/module.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index db43046a95..035625b095 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -475,6 +475,7 @@ class module implements \phpbb\db\migration\tool\tool_interface if (!class_exists('acp_modules')) { include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); + $this->user->add_lang('acp/modules'); } $acp_modules = new \acp_modules(); $module = $acp_modules->get_module_infos($basename, $class, true); -- cgit v1.2.1 From f756632185c696c31cc6dfcf0ddfa092b6faf118 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 10 Jan 2015 15:14:58 +0100 Subject: [ticket/13486] Fix typo in method name PHPBB3-13486 --- .../migration/data/v31x/profilefield_remove_underscore_from_alpha.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php index 1f25d239a6..60491f8de8 100644 --- a/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php +++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php @@ -40,8 +40,8 @@ class profilefield_remove_underscore_from_alpha extends \phpbb\db\migration\migr public function update_validation_rule($old_validation, $new_validation) { $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " - SET field_validation = '" . $this->db->sql_escpape($new_validation) . "' - WHERE field_validation = '" . $this->db->sql_escpape($old_validation) . "'"; + SET field_validation = '" . $this->db->sql_escape($new_validation) . "' + WHERE field_validation = '" . $this->db->sql_escape($old_validation) . "'"; $this->db->sql_query($sql); } } -- cgit v1.2.1 From c99ed6447371fc548442f8b44312954c43bfbcb6 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 14 Jan 2015 11:04:42 +0100 Subject: [ticket/13489] Disable the event dispatcher in the migrator PHPBB3-13489 --- phpBB/phpbb/db/migrator.php | 52 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index d03496eae3..7fc3e787e2 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -13,11 +13,19 @@ namespace phpbb\db; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * The migrator is responsible for applying new migrations in the correct order. */ class migrator { + /** + * @var ContainerInterface + */ + protected $container; + /** @var \phpbb\config\config */ protected $config; @@ -77,15 +85,16 @@ class migrator /** * The output handler. A null handler is configured by default. * - * @var migrator_output_handler + * @var migrator_output_handler_interface */ public $output_handler; /** * Constructor of the database migrator */ - public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper) + public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper) { + $this->container = $container; $this->config = $config; $this->db = $db; $this->db_tools = $db_tools; @@ -171,6 +180,18 @@ class migrator * @return null */ public function update() + { + $this->container->get('dispatcher')->disable(); + $this->update_do(); + $this->container->get('dispatcher')->enable(); + } + + /** + * Effectively runs a single update step from the next migration to be applied. + * + * @return null + */ + protected function update_do() { foreach ($this->migrations as $name) { @@ -317,7 +338,7 @@ class migrator catch (\phpbb\db\migration\exception $e) { // Revert the schema changes - $this->revert($name); + $this->revert_do($name); // Rethrow exception throw $e; @@ -337,9 +358,21 @@ class migrator * check if revert() needs to be called again use the migration_state() method. * * @param string $migration String migration name to revert (including any that depend on this migration) - * @return null */ public function revert($migration) + { + $this->container->get('dispatcher')->disable(); + $this->revert_do($migration); + $this->container->get('dispatcher')->enable(); + } + + /** + * Effectively runs a single revert step from the last migration installed + * + * @param string $migration String migration name to revert (including any that depend on this migration) + * @return null + */ + protected function revert_do($migration) { if (!isset($this->migration_state[$migration])) { @@ -351,7 +384,7 @@ class migrator { if (!empty($state['migration_depends_on']) && in_array($migration, $state['migration_depends_on'])) { - $this->revert($name); + $this->revert_do($name); } } @@ -742,7 +775,14 @@ class migrator */ protected function get_migration($name) { - return new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix); + $migration = new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix); + + if ($migration instanceof ContainerAwareInterface) + { + $migration->setContainer($this->container); + } + + return $migration; } /** -- cgit v1.2.1 From ce47170c29f4bd7b6a9a4dc74f95be5b4241872d Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 14 Jan 2015 12:07:53 +0100 Subject: [ticket/13489] Update migrations PHPBB3-13489 --- .../db/migration/data/v30x/release_3_0_5_rc1.php | 22 +++++++++++--- .../data/v310/soft_delete_mod_convert.php | 34 +++++++++++++--------- .../db/migration/profilefield_base_migration.php | 21 +++++++++++-- 3 files changed, 57 insertions(+), 20 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index 2cc7786046..dc79071e16 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -13,8 +13,16 @@ namespace phpbb\db\migration\data\v30x; -class release_3_0_5_rc1 extends \phpbb\db\migration\migration +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +class release_3_0_5_rc1 extends \phpbb\db\migration\migration implements ContainerAwareInterface { + /** + * @var ContainerInterface + */ + protected $container; + public function effectively_installed() { return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>='); @@ -55,9 +63,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration public function hash_old_passwords() { - global $phpbb_container; - - $passwords_manager = $phpbb_container->get('passwords.manager'); + $passwords_manager = $this->container->get('passwords.manager'); $sql = 'SELECT user_id, user_password FROM ' . $this->table_prefix . 'users WHERE user_pass_convert = 1'; @@ -130,4 +136,12 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration } } } + + /** + * {@inheritdoc} + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } } diff --git a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php index 58845b88ec..c21b75b881 100644 --- a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php +++ b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php @@ -13,13 +13,21 @@ namespace phpbb\db\migration\data\v310; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * Migration to convert the Soft Delete MOD for 3.0 * * https://www.phpbb.com/customise/db/mod/soft_delete/ */ -class soft_delete_mod_convert extends \phpbb\db\migration\migration +class soft_delete_mod_convert extends \phpbb\db\migration\migration implements ContainerAwareInterface { + /** + * @var ContainerInterface + */ + protected $container; + static public function depends_on() { return array( @@ -115,19 +123,19 @@ class soft_delete_mod_convert extends \phpbb\db\migration\migration } } + /** + * @return \phpbb\content_visibility + */ protected function get_content_visibility() { - return new \phpbb\content_visibility( - new \phpbb\auth\auth(), - $this->config, - $this->db, - new \phpbb\user('\phpbb\datetime'), - $this->phpbb_root_path, - $this->php_ext, - $this->table_prefix . 'forums', - $this->table_prefix . 'posts', - $this->table_prefix . 'topics', - $this->table_prefix . 'users' - ); + return $this->container->get('content.visibility'); + } + + /** + * {@inheritdoc} + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; } } diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 9000949a7d..02954d109c 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -13,7 +13,10 @@ namespace phpbb\db\migration; -abstract class profilefield_base_migration extends \phpbb\db\migration\migration +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +abstract class profilefield_base_migration extends \phpbb\db\migration\migration implements ContainerAwareInterface { protected $profilefield_name; @@ -40,6 +43,11 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration protected $user_column_name; + /** + * @var ContainerInterface + */ + protected $container; + public function effectively_installed() { return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields_data', 'pf_' . $this->profilefield_name); @@ -237,11 +245,18 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration if ($profile_row === null) { - global $phpbb_container; - $manager = $phpbb_container->get('profilefields.manager'); + $manager = $this->container->get('profilefields.manager'); $profile_row = $manager->build_insert_sql_array(array()); } return $profile_row; } + + /** + * {@inheritdoc} + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } } -- cgit v1.2.1 From 8002af752683cf055e792a45394cb4ffc627daeb Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Jan 2015 00:11:45 +0700 Subject: [ticket/13492] Add the migration to update custom bbcodes with IDN regexps Also fix the $utf8 checking regexp removing the curly braces. PHPBB3-13492 --- .../data/v31x/update_custom_bbcodes_with_idn.php | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php new file mode 100644 index 0000000000..854ed1f568 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php @@ -0,0 +1,70 @@ + +* @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 update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v312', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_bbcodes_table'))), + ); + } + + public function update_bbcodes_table() + { + if (!class_exists('acp_bbcodes')) + { + include($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext); + } + + $bbcodes = new \acp_bbcodes(); + + $sql = 'SELECT bbcode_id, bbcode_match, bbcode_tpl + FROM ' . BBCODES_TABLE; + $result = $this->sql_query($sql); + + $sql_ary = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $data = array(); + if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match'])) + { + $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']); + $sql_ary[$row['bbcode_id']] = array( + 'first_pass_match' => $data['first_pass_match'], + 'first_pass_replace' => $data['first_pass_replace'], + 'second_pass_match' => $data['second_pass_match'], + 'second_pass_replace' => $data['second_pass_replace'] + ); + } + } + $this->db->sql_freeresult($result); + + foreach ($sql_ary as $bbcode_id => $bbcode_data) + { + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' + WHERE bbcode_id = ' . (int) $bbcode_id; + $this->sql_query($sql); + } + } +} -- cgit v1.2.1 From dab07283573689fcc6eb2c4e270ac37c3a573959 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 14 Jan 2015 12:32:47 +0100 Subject: [ticket/13489] Fix service configuration PHPBB3-13489 --- .../db/migration/container_aware_migration.php | 36 ++++++++++++++++++++++ .../db/migration/data/v30x/release_3_0_5_rc1.php | 18 ++--------- .../data/v310/soft_delete_mod_convert.php | 18 ++--------- .../db/migration/profilefield_base_migration.php | 18 +---------- 4 files changed, 41 insertions(+), 49 deletions(-) create mode 100644 phpBB/phpbb/db/migration/container_aware_migration.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/container_aware_migration.php b/phpBB/phpbb/db/migration/container_aware_migration.php new file mode 100644 index 0000000000..3b4b49b04b --- /dev/null +++ b/phpBB/phpbb/db/migration/container_aware_migration.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; + +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* Abstract base class for container aware database migrations. +*/ +abstract class container_aware_migration extends migration implements ContainerAwareInterface +{ + /** + * @var ContainerInterface + */ + protected $container; + + /** + * {@inheritdoc} + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index dc79071e16..c3e887841f 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -13,16 +13,10 @@ namespace phpbb\db\migration\data\v30x; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use phpbb\db\migration\container_aware_migration; -class release_3_0_5_rc1 extends \phpbb\db\migration\migration implements ContainerAwareInterface +class release_3_0_5_rc1 extends container_aware_migration { - /** - * @var ContainerInterface - */ - protected $container; - public function effectively_installed() { return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>='); @@ -136,12 +130,4 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration implements Contain } } } - - /** - * {@inheritdoc} - */ - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } } diff --git a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php index c21b75b881..85b90da5fa 100644 --- a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php +++ b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php @@ -13,21 +13,15 @@ namespace phpbb\db\migration\data\v310; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use phpbb\db\migration\container_aware_migration; /** * Migration to convert the Soft Delete MOD for 3.0 * * https://www.phpbb.com/customise/db/mod/soft_delete/ */ -class soft_delete_mod_convert extends \phpbb\db\migration\migration implements ContainerAwareInterface +class soft_delete_mod_convert extends container_aware_migration { - /** - * @var ContainerInterface - */ - protected $container; - static public function depends_on() { return array( @@ -130,12 +124,4 @@ class soft_delete_mod_convert extends \phpbb\db\migration\migration implements C { return $this->container->get('content.visibility'); } - - /** - * {@inheritdoc} - */ - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } } diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 02954d109c..da1a38e2fa 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -13,10 +13,7 @@ namespace phpbb\db\migration; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -abstract class profilefield_base_migration extends \phpbb\db\migration\migration implements ContainerAwareInterface +abstract class profilefield_base_migration extends container_aware_migration { protected $profilefield_name; @@ -43,11 +40,6 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration protected $user_column_name; - /** - * @var ContainerInterface - */ - protected $container; - public function effectively_installed() { return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields_data', 'pf_' . $this->profilefield_name); @@ -251,12 +243,4 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration return $profile_row; } - - /** - * {@inheritdoc} - */ - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } } -- cgit v1.2.1 From ed6b8f84ad07a8aaa88124bb29e26f9042c3f552 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Jan 2015 23:36:45 +0100 Subject: [ticket/13530] Fix undefined variables PHPBB3-13530 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index c3e887841f..003ccf8f18 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -110,7 +110,7 @@ class release_3_0_5_rc1 extends container_aware_migration // Select auth_option_ids... the largest id will be preserved $sql = 'SELECT auth_option_id FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option = '" . $db->sql_escape($option) . "' + WHERE auth_option = '" . $this->db->sql_escape($option) . "' ORDER BY auth_option_id DESC"; // sql_query_limit not possible here, due to bug in postgresql layer $result = $this->db->sql_query($sql); -- cgit v1.2.1 From 1367fc234fce4f2e79c02e3780b5727faa5992e4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 22 Jan 2015 00:06:25 +0100 Subject: [ticket/13282] Use 0 as default for integer type columns in postgresql PHPBB3-13282 --- phpBB/phpbb/db/tools.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index f523b39fb3..ee0d247071 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1574,7 +1574,15 @@ class tools } else { - $default_val = "'" . $column_data[1] . "'"; + // Integers need to have 0 instead of empty string as default + if (preg_match('/int/i', $column_type)) + { + $default_val = '0'; + } + else + { + $default_val = "'" . $column_data[1] . "'"; + } $return_array['null'] = 'NULL'; $sql .= 'NULL '; } -- cgit v1.2.1 From 816465bfe90c955a9fc7b748b0ff22b5e775c7a9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 22 Jan 2015 10:11:08 +0100 Subject: [ticket/13282] Use strpos() instead of preg_match() PHPBB3-13282 --- phpBB/phpbb/db/tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index ee0d247071..775deccc30 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1575,7 +1575,7 @@ class tools else { // Integers need to have 0 instead of empty string as default - if (preg_match('/int/i', $column_type)) + if (strpos($column_type, 'INT') === 0) { $default_val = '0'; } -- cgit v1.2.1 From 32b25d7b1134ccb828c16475377436597afda868 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 26 Jan 2015 19:43:36 +0100 Subject: [prep-release-3.1.3] Add migration for 3.1.3-RC1 --- phpBB/phpbb/db/migration/data/v31x/v313rc1.php | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v313rc1.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc1.php b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php new file mode 100644 index 0000000000..e50754f805 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php @@ -0,0 +1,35 @@ + +* @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 v313rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\release_3_0_13_rc1', + '\phpbb\db\migration\data\v31x\plupload_last_gc_dynamic', + '\phpbb\db\migration\data\v31x\profilefield_remove_underscore_from_alpha', + '\phpbb\db\migration\data\v31x\profilefield_yahoo_update_url', + '\phpbb\db\migration\data\v31x\update_custom_bbcodes_with_idn', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.3-RC1')), + ); + } +} -- cgit v1.2.1 From 73d1bf9fea8ea691f4b2b5c133ab973ea115e2e4 Mon Sep 17 00:00:00 2001 From: brunoais Date: Mon, 26 Jan 2015 19:21:22 +0000 Subject: [ticket/13544] Fixing wrong SQL query for permission_unset for roles PHPBB3-13544 --- phpBB/phpbb/db/migration/tool/permission.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 5cfbc5ca00..2daed2724a 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -537,7 +537,8 @@ class permission implements \phpbb\db\migration\tool\tool_interface } $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' - WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove); + WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . ' + AND role_id = ' . $this->db->sql_escape($role_id); $this->db->sql_query($sql); break; -- cgit v1.2.1 From 4b16add055fd9486a82dc3a9b2a1105ee144a492 Mon Sep 17 00:00:00 2001 From: brunoais Date: Mon, 26 Jan 2015 22:00:20 +0000 Subject: [ticket/13544] Use integer case because $role_id is an int PHPBB3-13544 --- phpBB/phpbb/db/migration/tool/permission.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 2daed2724a..1a91127d2d 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -538,7 +538,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . ' - AND role_id = ' . $this->db->sql_escape($role_id); + AND role_id = ' . (int) $role_id; $this->db->sql_query($sql); break; -- cgit v1.2.1 From 9628e8df3bb672c1c5859f184fa806f650282e16 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 30 Jan 2015 22:57:15 +0100 Subject: [ticket/13557] Add migrations for 3.0.13 and 3.0.13-PL1 PHPBB3-13557 --- .../db/migration/data/v30x/release_3_0_13.php | 37 ++++++++++++++++++++++ .../db/migration/data/v30x/release_3_0_13_pl1.php | 37 ++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php new file mode 100644 index 0000000000..310fcc70fc --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php @@ -0,0 +1,37 @@ + +* @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\v30x; + +class release_3_0_13 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.13', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_13_rc1'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.13', '<'), + array('config.update', array('version', '3.0.13')), + )), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php new file mode 100644 index 0000000000..b12a96a7fb --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php @@ -0,0 +1,37 @@ + +* @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\v30x; + +class release_3_0_13_pl1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.13-PL1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_13'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.13-PL1', '<'), + array('config.update', array('version', '3.0.13-PL1')), + )), + ); + } +} -- cgit v1.2.1 From 9232367b3545731060bb6db238fbe94129c735be Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 31 Jan 2015 01:06:23 +0100 Subject: [prep-release-3.1.3] Add migration for 3.1.3-RC2 --- phpBB/phpbb/db/migration/data/v31x/v313rc2.php | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v313rc2.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc2.php b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php new file mode 100644 index 0000000000..d832d6f502 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php @@ -0,0 +1,32 @@ + +* @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 v313rc2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\release_3_0_13_pl1', + '\phpbb\db\migration\data\v31x\v313rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.3-RC2')), + ); + } +} -- cgit v1.2.1 From 7f99e1c8576ff9f4c7dda68d5d4485b29e090dd5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 1 Feb 2015 19:18:30 +0100 Subject: [prep-release-3.1.3] Add migration for 3.1.3 --- phpBB/phpbb/db/migration/data/v31x/v313.php | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v313.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v31x/v313.php b/phpBB/phpbb/db/migration/data/v31x/v313.php new file mode 100644 index 0000000000..5a4e21a9b7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v313.php @@ -0,0 +1,31 @@ + +* @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 v313 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v313rc2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.3')), + ); + } +} -- cgit v1.2.1