From f3e5acf3776083ec39052a3b8bf179638703d47e Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Thu, 26 Apr 2012 10:37:37 +0100 Subject: [ticket/10845] Changed the report system. Now it saves posts with the bbcode Now the bitfield and uid of the bbcode is saved in the reports table. This will allow parsing the BBCode while loading the post to show PHPBB3-10845 --- phpBB/install/schemas/firebird_schema.sql | 4 +++- phpBB/install/schemas/mssql_schema.sql | 4 +++- phpBB/install/schemas/mysql_40_schema.sql | 2 ++ phpBB/install/schemas/mysql_41_schema.sql | 2 ++ phpBB/install/schemas/oracle_schema.sql | 2 ++ phpBB/install/schemas/postgres_schema.sql | 2 ++ phpBB/install/schemas/sqlite_schema.sql | 4 +++- 7 files changed, 17 insertions(+), 3 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 51565ef2d4..de8d05c1a3 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -910,7 +910,9 @@ CREATE TABLE phpbb_reports ( report_closed INTEGER DEFAULT 0 NOT NULL, report_time INTEGER DEFAULT 0 NOT NULL, report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL + reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + reported_post_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + reported_post_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 2c78dd009f..a9ddda646e 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1109,7 +1109,9 @@ CREATE TABLE [phpbb_reports] ( [report_closed] [int] DEFAULT (0) NOT NULL , [report_time] [int] DEFAULT (0) NOT NULL , [report_text] [text] DEFAULT ('') NOT NULL , - [reported_post_text] [text] DEFAULT ('') NOT NULL + [reported_post_text] [text] DEFAULT ('') NOT NULL , + [reported_post_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , + [reported_post_uid] [varchar] (8) DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index d19f1930d0..0e4db1597d 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -648,6 +648,8 @@ CREATE TABLE phpbb_reports ( report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, reported_post_text mediumblob NOT NULL, + reported_post_bitfield varbinary(255) DEFAULT '' NOT NULL, + reported_post_uid varbinary(8) DEFAULT '' NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 3fd8d4f1d1..606a77c6d8 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -648,6 +648,8 @@ CREATE TABLE phpbb_reports ( report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumtext NOT NULL, reported_post_text mediumtext NOT NULL, + reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, + reported_post_uid varchar(8) DEFAULT '' NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 8a0f3e56b1..892db76519 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1215,6 +1215,8 @@ CREATE TABLE phpbb_reports ( report_time number(11) DEFAULT '0' NOT NULL, report_text clob DEFAULT '' , reported_post_text clob DEFAULT '' , + reported_post_bitfield varchar2(255) DEFAULT '' , + reported_post_uid varchar2(8) DEFAULT '' , CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index c624024362..bb381b75fa 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -854,6 +854,8 @@ CREATE TABLE phpbb_reports ( report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0), report_text TEXT DEFAULT '' NOT NULL, reported_post_text TEXT DEFAULT '' NOT NULL, + reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, + reported_post_uid varchar(8) DEFAULT '' NOT NULL, PRIMARY KEY (report_id) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index bd002c93ed..de9da85a77 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -628,7 +628,9 @@ CREATE TABLE phpbb_reports ( report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0', report_time INTEGER UNSIGNED NOT NULL DEFAULT '0', report_text mediumtext(16777215) NOT NULL DEFAULT '', - reported_post_text mediumtext(16777215) NOT NULL DEFAULT '' + reported_post_text mediumtext(16777215) NOT NULL DEFAULT '', + reported_post_bitfield varchar(255) NOT NULL DEFAULT '', + reported_post_uid varchar(8) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); -- cgit v1.2.1 From 6069d9a3d7479f1fe0e7e7072aee0f3ea394519b Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Sun, 6 May 2012 15:28:55 +0100 Subject: [ticket/10845] Two of the three colouns were missing in the DB update file Added the two colouns that were missing in the DB update file PHPBB3-10845 --- phpBB/install/database_update.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a0892005d2..3c4a7f7027 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1102,7 +1102,9 @@ function database_update_info() 'style_parent_tree' => array('TEXT', ''), ), REPORTS_TABLE => array( - 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_uid' => array('VCHAR:8', ''), + 'reported_post_bitfield' => array('VCHAR:255', ''), ), ), 'change_columns' => array( -- cgit v1.2.1 From 5f5d395c625fe0257e7bca5d787424808f7649cc Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 29 Oct 2012 13:58:24 -0400 Subject: [ticket/11158] Require acl_u_sig for ucp signature module. PHPBB3-11158 --- phpBB/install/database_update.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 40837145ba..099ab6aeb5 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1005,6 +1005,8 @@ function database_update_info() ), // No changes from 3.0.11-RC2 to 3.0.11 '3.0.11-RC2' => array(), + // No changes from 3.0.11 to 3.0.12-RC1 + '3.0.11' => array(), /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */ ); @@ -2108,6 +2110,16 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.11-RC2 to 3.0.11 case '3.0.11-RC2': break; + + // Changes from 3.0.11 to 3.0.12-RC1 + case '3.0.11': + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'acl_u_sig\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'signature\''; + _sql($sql, $errored, $error_ary); + break; } } -- cgit v1.2.1 From 767d09227bd848da21dc3e255b1dacd20cbad1f7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 2 Nov 2012 18:51:35 -0400 Subject: [ticket/10933] Dependency inject template context. PHPBB3-10933 --- phpBB/install/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 4f1fbee7ad..f71e5ada54 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -213,7 +213,7 @@ $config = new phpbb_config(array( $phpbb_style_resource_locator = new phpbb_style_resource_locator(); $phpbb_style_path_provider = new phpbb_style_path_provider(); -$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator); +$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, new phpbb_template_context()); $phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template); $phpbb_style->set_ext_dir_prefix('adm/'); $phpbb_style->set_custom_style('admin', '../adm/style', ''); -- cgit v1.2.1 From 399662d2afa58dfd631128e3eac033d90464f794 Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 28 Aug 2012 09:56:59 +0200 Subject: [ticket/10897] Bot list updated 'Baidu [Spider]' updated. 'Bing [Bot]' fixed only identation. 'Exabot [Bot]' changed because there is used also 'Exabot-Thumbnails' user agent. 'NG-Search [Bot]' no longer exists. 'Nutch/CVS [Bot]' is the same of 'Nutch [Bot]'. 'OmniExplorer [Bot]' no longer exists. 'Seekport [Bot]' no longer exists. 'Synoo [Bot]' no longer exists. 'Voyager [Bot]' updated. 'W3C [Validator]' corrected (there was a *). 'WiseNut [Bot]' no longer exists. PHPBB3-10897 --- phpBB/install/install_install.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index f1003b07d7..67ebb8b1c5 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -2103,9 +2103,9 @@ class install_install extends module 'Alexa [Bot]' => array('ia_archiver', ''), 'Alta Vista [Bot]' => array('Scooter/', ''), 'Ask Jeeves [Bot]' => array('Ask Jeeves', ''), - 'Baidu [Spider]' => array('Baiduspider+(', ''), - 'Bing [Bot]' => array('bingbot/', ''), - 'Exabot [Bot]' => array('Exabot/', ''), + 'Baidu [Spider]' => array('Baiduspider', ''), + 'Bing [Bot]' => array('bingbot/', ''), + 'Exabot [Bot]' => array('Exabot', ''), 'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''), 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''), 'Francis [Bot]' => array('http://www.neomo.de/', ''), @@ -2124,27 +2124,21 @@ class install_install extends module 'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''), 'MSN [Bot]' => array('msnbot/', ''), 'MSNbot Media' => array('msnbot-media/', ''), - 'NG-Search [Bot]' => array('NG-Search/', ''), 'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''), - 'Nutch/CVS [Bot]' => array('NutchCVS/', ''), - 'OmniExplorer [Bot]' => array('OmniExplorer_Bot/', ''), 'Online link [Validator]' => array('online link validator', ''), 'psbot [Picsearch]' => array('psbot/0', ''), - 'Seekport [Bot]' => array('Seekbot/', ''), 'Sensis [Crawler]' => array('Sensis Web Crawler', ''), 'SEO Crawler' => array('SEO search Crawler/', ''), 'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''), 'SEOSearch [Crawler]' => array('SEOsearch/', ''), 'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''), 'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''), - 'Synoo [Bot]' => array('SynooBot/', ''), 'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''), 'TurnitinBot [Bot]' => array('TurnitinBot/', ''), - 'Voyager [Bot]' => array('voyager/1.0', ''), + 'Voyager [Bot]' => array('voyager/', ''), 'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''), 'W3C [Linkcheck]' => array('W3C-checklink/', ''), - 'W3C [Validator]' => array('W3C_*Validator', ''), - 'WiseNut [Bot]' => array('http://www.WISEnutbot.com', ''), + 'W3C [Validator]' => array('W3C_Validator', ''), 'YaCy [Bot]' => array('yacybot', ''), 'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''), 'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''), -- cgit v1.2.1 From 53e9bab237470e827243fcf3743eb7ca3d9ee346 Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 28 Aug 2012 10:02:27 +0200 Subject: [ticket/10897] Update bots during phpBB update PHPBB3-10897 --- phpBB/install/database_update.php | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 099ab6aeb5..0343e0dc86 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2119,6 +2119,76 @@ function change_database_data(&$no_updates, $version) AND module_basename = \'profile\' AND module_mode = \'signature\''; _sql($sql, $errored, $error_ary); + + $bots_to_update = array( + 'Baidu [Spider]' => array('Baiduspider', ''), + 'Exabot [Bot]' => array('Exabot', ''), + 'Voyager [Bot]' => array('voyager/', ''), + 'W3C [Validator]' => array('W3C_Validator', ''), + ); + + $bots_to_delete = array( + 'NG-Search [Bot]', + 'Nutch/CVS [Bot]', + 'OmniExplorer [Bot]', + 'Seekport [Bot]', + 'Synoo [Bot]', + 'WiseNut [Bot]', + ); + + foreach($bots_to_update as $bot_name => $bot_array) + { + list($bot_agent, $bot_ip) = $bot_array; + + $bot_name_clean = utf8_clean_string($bot_name); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'"; + $result = $db->sql_query($sql); + $is_user = (bool) $db->sql_fetchfield('user_id'); + $db->sql_freeresult($result); + + if ($is_user) + { + $sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + 'bot_agent' => (string) $bot_agent, + 'bot_ip' => (string) $bot_ip, + )) . " WHERE bot_name = '" . $db->sql_escape($bot_name) . "'"; + + _sql($sql, $errored, $error_ary); + } + } + + if (!function_exists('user_delete')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + foreach($bots_to_delete as $bot_name) + { + $bot_name_clean = utf8_clean_string($bot_name); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'"; + $result = $db->sql_query($sql); + $bot_user_id = $db->sql_fetchfield('user_id'); + $is_user = (bool) $bot_user_id; + $db->sql_freeresult($result); + + if ($is_user) + { + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE bot_name = '" . $db->sql_escape($bot_name) . "'"; + + _sql($sql, $errored, $error_ary); + + user_delete('remove', $bot_user_id); + } + } + + $no_updates = false; break; } } -- cgit v1.2.1 From 07e7c475d510a221c9080529647ec432cca038c6 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:12:12 +0100 Subject: [ticket/10897] Add space after foreach. PHPBB3-10897 --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 0343e0dc86..4c94cdf5bd 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2136,7 +2136,7 @@ function change_database_data(&$no_updates, $version) 'WiseNut [Bot]', ); - foreach($bots_to_update as $bot_name => $bot_array) + foreach ($bots_to_update as $bot_name => $bot_array) { list($bot_agent, $bot_ip) = $bot_array; @@ -2165,7 +2165,7 @@ function change_database_data(&$no_updates, $version) include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - foreach($bots_to_delete as $bot_name) + foreach ($bots_to_delete as $bot_name) { $bot_name_clean = utf8_clean_string($bot_name); -- cgit v1.2.1 From b2183c9b705dc5283f3a1c3abbc80331f74e4b72 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:12:27 +0100 Subject: [ticket/10897] Remove unnecessary string casting. PHPBB3-10897 --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4c94cdf5bd..bbb05e67ec 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2152,8 +2152,8 @@ function change_database_data(&$no_updates, $version) if ($is_user) { $sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( - 'bot_agent' => (string) $bot_agent, - 'bot_ip' => (string) $bot_ip, + 'bot_agent' => $bot_agent, + 'bot_ip' => $bot_ip, )) . " WHERE bot_name = '" . $db->sql_escape($bot_name) . "'"; _sql($sql, $errored, $error_ary); -- cgit v1.2.1 From de6d741d96e57a704e7653e8c73a20b3c196a0d9 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:19:18 +0100 Subject: [ticket/10897] Add comment about what's going on. PHPBB3-10897 --- phpBB/install/database_update.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index bbb05e67ec..c8675fa95a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2120,6 +2120,7 @@ function change_database_data(&$no_updates, $version) AND module_mode = \'signature\''; _sql($sql, $errored, $error_ary); + // Update bot list $bots_to_update = array( 'Baidu [Spider]' => array('Baiduspider', ''), 'Exabot [Bot]' => array('Exabot', ''), -- cgit v1.2.1 From 935bc33268bb062158d6421242335483fcd955bd Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:19:58 +0100 Subject: [ticket/10897] Move bot delete data to the relevant foreach loop. PHPBB3-10897 --- phpBB/install/database_update.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c8675fa95a..0372b6e608 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2128,15 +2128,6 @@ function change_database_data(&$no_updates, $version) 'W3C [Validator]' => array('W3C_Validator', ''), ); - $bots_to_delete = array( - 'NG-Search [Bot]', - 'Nutch/CVS [Bot]', - 'OmniExplorer [Bot]', - 'Seekport [Bot]', - 'Synoo [Bot]', - 'WiseNut [Bot]', - ); - foreach ($bots_to_update as $bot_name => $bot_array) { list($bot_agent, $bot_ip) = $bot_array; @@ -2166,6 +2157,15 @@ function change_database_data(&$no_updates, $version) include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } + $bots_to_delete = array( + 'NG-Search [Bot]', + 'Nutch/CVS [Bot]', + 'OmniExplorer [Bot]', + 'Seekport [Bot]', + 'Synoo [Bot]', + 'WiseNut [Bot]', + ); + foreach ($bots_to_delete as $bot_name) { $bot_name_clean = utf8_clean_string($bot_name); -- cgit v1.2.1 From 63c64694bc253358a50dce7dce99a7551b5e2b17 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:41:59 +0100 Subject: [ticket/10897] Update by user_id instead of bot_name. PHPBB3-10897 --- phpBB/install/database_update.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 0372b6e608..6496069658 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2132,22 +2132,23 @@ function change_database_data(&$no_updates, $version) { list($bot_agent, $bot_ip) = $bot_array; - $bot_name_clean = utf8_clean_string($bot_name); - $sql = 'SELECT user_id FROM ' . USERS_TABLE . " - WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; $result = $db->sql_query($sql); - $is_user = (bool) $db->sql_fetchfield('user_id'); + $bot_user_id = (int) $db->sql_fetchfield('user_id'); $db->sql_freeresult($result); - if ($is_user) + if ($bot_user_id) { - $sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + $update_array = array( 'bot_agent' => $bot_agent, 'bot_ip' => $bot_ip, - )) . " WHERE bot_name = '" . $db->sql_escape($bot_name) . "'"; + ); + $sql = 'UPDATE ' . BOTS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $update_array) . " + WHERE user_id = $bot_user_id"; _sql($sql, $errored, $error_ary); } } -- cgit v1.2.1 From c054757f3caad66152eaafe09f2c98abcb9ef0e2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:45:20 +0100 Subject: [ticket/10897] Do not handle IP address. There is no need. PHPBB3-10897 --- phpBB/install/database_update.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 6496069658..154fc313a0 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2121,17 +2121,16 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); // Update bot list + // Bot name to bot user agent map $bots_to_update = array( - 'Baidu [Spider]' => array('Baiduspider', ''), - 'Exabot [Bot]' => array('Exabot', ''), - 'Voyager [Bot]' => array('voyager/', ''), - 'W3C [Validator]' => array('W3C_Validator', ''), + 'Baidu [Spider]' => 'Baiduspider', + 'Exabot [Bot]' => 'Exabot', + 'Voyager [Bot]' => 'voyager/', + 'W3C [Validator]' => 'W3C_Validator', ); - foreach ($bots_to_update as $bot_name => $bot_array) + foreach ($bots_to_update as $bot_name => $bot_agent) { - list($bot_agent, $bot_ip) = $bot_array; - $sql = 'SELECT user_id FROM ' . USERS_TABLE . " WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; @@ -2141,13 +2140,8 @@ function change_database_data(&$no_updates, $version) if ($bot_user_id) { - $update_array = array( - 'bot_agent' => $bot_agent, - 'bot_ip' => $bot_ip, - ); - $sql = 'UPDATE ' . BOTS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $update_array) . " + SET bot_agent = ' . $db->sql_escape($bot_agent) . " WHERE user_id = $bot_user_id"; _sql($sql, $errored, $error_ary); } -- cgit v1.2.1 From 520ffdf368bee84549a0b284bd2df4da1d633a8f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:47:50 +0100 Subject: [ticket/10897] Make sure the user we're fetching is a bot. PHPBB3-10897 --- phpBB/install/database_update.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 154fc313a0..bd12a90288 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2132,8 +2132,9 @@ function change_database_data(&$no_updates, $version) foreach ($bots_to_update as $bot_name => $bot_agent) { $sql = 'SELECT user_id - FROM ' . USERS_TABLE . " - WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_IGNORE . " + AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; $result = $db->sql_query($sql); $bot_user_id = (int) $db->sql_fetchfield('user_id'); $db->sql_freeresult($result); -- cgit v1.2.1 From 54700f5ba24fe944616e017c3c2ff9c09c312445 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:53:33 +0100 Subject: [ticket/10897] Use same code/query for deleting. PHPBB3-10897 --- phpBB/install/database_update.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index bd12a90288..b8bf85e283 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2164,21 +2164,18 @@ function change_database_data(&$no_updates, $version) foreach ($bots_to_delete as $bot_name) { - $bot_name_clean = utf8_clean_string($bot_name); - $sql = 'SELECT user_id - FROM ' . USERS_TABLE . " - WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'"; + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_IGNORE . " + AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; $result = $db->sql_query($sql); - $bot_user_id = $db->sql_fetchfield('user_id'); - $is_user = (bool) $bot_user_id; + $bot_user_id = (int) $db->sql_fetchfield('user_id'); $db->sql_freeresult($result); - if ($is_user) + if ($bot_user_id) { $sql = 'DELETE FROM ' . BOTS_TABLE . " - WHERE bot_name = '" . $db->sql_escape($bot_name) . "'"; - + WHERE user_id = $bot_user_id"; _sql($sql, $errored, $error_ary); user_delete('remove', $bot_user_id); -- cgit v1.2.1 From 60ea1c10ef0038fdb00fd38253d4b7407215e699 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 12:59:05 +0100 Subject: [ticket/10897] Combine bot updates and bot delete. PHPBB3-10897 --- phpBB/install/database_update.php | 71 +++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 40 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b8bf85e283..f7980ab1be 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2120,49 +2120,30 @@ function change_database_data(&$no_updates, $version) AND module_mode = \'signature\''; _sql($sql, $errored, $error_ary); - // Update bot list - // Bot name to bot user agent map - $bots_to_update = array( - 'Baidu [Spider]' => 'Baiduspider', - 'Exabot [Bot]' => 'Exabot', - 'Voyager [Bot]' => 'voyager/', - 'W3C [Validator]' => 'W3C_Validator', - ); - - foreach ($bots_to_update as $bot_name => $bot_agent) - { - $sql = 'SELECT user_id - FROM ' . USERS_TABLE . ' - WHERE user_type = ' . USER_IGNORE . " - AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; - $result = $db->sql_query($sql); - $bot_user_id = (int) $db->sql_fetchfield('user_id'); - $db->sql_freeresult($result); - - if ($bot_user_id) - { - $sql = 'UPDATE ' . BOTS_TABLE . ' - SET bot_agent = ' . $db->sql_escape($bot_agent) . " - WHERE user_id = $bot_user_id"; - _sql($sql, $errored, $error_ary); - } - } - + // Update bots if (!function_exists('user_delete')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $bots_to_delete = array( - 'NG-Search [Bot]', - 'Nutch/CVS [Bot]', - 'OmniExplorer [Bot]', - 'Seekport [Bot]', - 'Synoo [Bot]', - 'WiseNut [Bot]', + $bots_updates = array( + // Bot Deletions + 'NG-Search [Bot]' => false, + 'Nutch/CVS [Bot]' => false, + 'OmniExplorer [Bot]' => false, + 'Seekport [Bot]' => false, + 'Synoo [Bot]' => false, + 'WiseNut [Bot]' => false, + + // Bot Updates + // Bot name to bot user agent map + 'Baidu [Spider]' => 'Baiduspider', + 'Exabot [Bot]' => 'Exabot', + 'Voyager [Bot]' => 'voyager/', + 'W3C [Validator]' => 'W3C_Validator', ); - foreach ($bots_to_delete as $bot_name) + foreach ($bots_updates as $bot_name => $bot_agent) { $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' @@ -2174,11 +2155,21 @@ function change_database_data(&$no_updates, $version) if ($bot_user_id) { - $sql = 'DELETE FROM ' . BOTS_TABLE . " - WHERE user_id = $bot_user_id"; - _sql($sql, $errored, $error_ary); + if ($bot_agent === false) + { + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE user_id = $bot_user_id"; + _sql($sql, $errored, $error_ary); - user_delete('remove', $bot_user_id); + user_delete('remove', $bot_user_id); + } + else + { + $sql = 'UPDATE ' . BOTS_TABLE . " + SET bot_agent = '" . $db->sql_escape($bot_agent) . "' + WHERE user_id = $bot_user_id"; + _sql($sql, $errored, $error_ary); + } } } -- cgit v1.2.1 From ed74c9c4870885cc3f1e04a2f68efb600012f529 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 9 Nov 2012 14:26:45 +0100 Subject: [ticket/11178] Do not set error_reporting to E_ALL in database_updater.php Take whatever startup.php sets instead. This especially takes care of E_STRICT messages that are generated because of PHP4 compatibility. PHPBB3-11178 --- phpBB/install/database_update.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 099ab6aeb5..b6299dbf7c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -60,8 +60,6 @@ $updates_to_version = UPDATES_TO_VERSION; $debug_from_version = DEBUG_FROM_VERSION; $oldest_from_version = OLDEST_FROM_VERSION; -error_reporting(E_ALL); - @set_time_limit(0); // Include essential scripts -- cgit v1.2.1 From 7d7dc98b10b586635fdee5c420e1ae9fa8d2b752 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 9 Nov 2012 23:16:42 +0100 Subject: [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2) PHPBB3-11181 --- phpBB/install/index.php | 4 ++-- phpBB/install/install_install.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/index.php b/phpBB/install/index.php index f71e5ada54..c6d0b4cef7 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -21,9 +21,9 @@ define('IN_INSTALL', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -if (version_compare(PHP_VERSION, '5.3.2') < 0) +if (version_compare(PHP_VERSION, '5.3.3') < 0) { - die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.2 or higher before trying to install phpBB 3.1'); + die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.3 or higher before trying to install phpBB 3.1'); } function phpbb_require_updated($path, $optional = false) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index eb9a92f4d1..f922d50416 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -143,7 +143,7 @@ class install_install extends module // Test the minimum PHP version $php_version = PHP_VERSION; - if (version_compare($php_version, '5.3.2') < 0) + if (version_compare($php_version, '5.3.3') < 0) { $result = '' . $lang['NO'] . ''; } -- cgit v1.2.1 From 195014867ae84fe04ec01c913e38bf1d435590f7 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 10 Nov 2012 11:25:22 +0100 Subject: [ticket/11183] Remove $load_extensions and weird dl() calls PHPBB3-11183 --- phpBB/install/database_update.php | 17 +++------------ phpBB/install/install_install.php | 44 ++++++++------------------------------- 2 files changed, 12 insertions(+), 49 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 527108af08..dcdd17cbc0 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -73,17 +73,6 @@ if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) die("Please read: INSTALL.html before attempting to update."); } -// Load Extensions -if (!empty($load_extensions) && function_exists('dl')) -{ - $load_extensions = explode(',', $load_extensions); - - foreach ($load_extensions as $extension) - { - @dl(trim($extension)); - } -} - // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); @@ -2716,10 +2705,10 @@ function change_database_data(&$no_updates, $version) // Create config value for displaying last subject on forum list if (!isset($config['display_last_subject'])) - { + { $config->set('display_last_subject', '1'); } - + $no_updates = false; if (!isset($config['assets_version'])) @@ -2752,7 +2741,7 @@ function change_database_data(&$no_updates, $version) // After we have calculated the timezones we can delete user_dst column from user table. $db_tools->sql_column_remove(USERS_TABLE, 'user_dst'); } - + if (!isset($config['site_home_url'])) { $config->set('site_home_url', ''); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index eb9a92f4d1..42102442f8 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -271,14 +271,6 @@ class install_install extends module 'S_LEGEND' => false, )); -/** -* Better not enabling and adding to the loaded extensions due to the specific requirements needed - if (!@extension_loaded('mbstring')) - { - can_load_dll('mbstring'); - } -*/ - $passed['mbstring'] = true; if (@extension_loaded('mbstring')) { @@ -382,17 +374,14 @@ class install_install extends module { if (!@extension_loaded($dll)) { - if (!can_load_dll($dll)) - { - $template->assign_block_vars('checks', array( - 'TITLE' => $lang['DLL_' . strtoupper($dll)], - 'RESULT' => '' . $lang['UNAVAILABLE'] . '', + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '' . $lang['UNAVAILABLE'] . '', - 'S_EXPLAIN' => false, - 'S_LEGEND' => false, - )); - continue; - } + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + continue; } $template->assign_block_vars('checks', array( @@ -873,22 +862,7 @@ class install_install extends module $written = false; // Create a list of any PHP modules we wish to have loaded - $load_extensions = array(); $available_dbms = get_available_dbms($data['dbms']); - $check_exts = array_merge(array($available_dbms[$data['dbms']]['MODULE']), $this->php_dlls_other); - - foreach ($check_exts as $dll) - { - if (!@extension_loaded($dll)) - { - if (!can_load_dll($dll)) - { - continue; - } - - $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX; - } - } // Create a lock file to indicate that there is an install in progress $fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb'); @@ -902,7 +876,7 @@ class install_install extends module @chmod($phpbb_root_path . 'cache/install_lock', 0777); // Time to convert the data provided into a config file - $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER'], $load_extensions); + $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER']); // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path)) @@ -1368,7 +1342,7 @@ class install_install extends module WHERE config_name = 'dbms_version'", ); - if (@extension_loaded('gd') || can_load_dll('gd')) + if (@extension_loaded('gd')) { $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config SET config_value = 'phpbb_captcha_gd' -- cgit v1.2.1 From 3ea5b0abbd7f4b0fc95c19a1b76214f044a7d44f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 10 Nov 2012 12:53:45 +0100 Subject: [ticket/10780] Make L_COLON available in the installer. PHPBB3-10780 --- phpBB/install/index.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/install') diff --git a/phpBB/install/index.php b/phpBB/install/index.php index c6d0b4cef7..753e5eb226 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -366,6 +366,7 @@ class module $template->assign_vars(array( 'L_CHANGE' => $lang['CHANGE'], + 'L_COLON' => $lang['COLON'], 'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'], 'L_SELECT_LANG' => $lang['SELECT_LANG'], 'L_SKIP' => $lang['SKIP'], -- cgit v1.2.1