From 0ce55e897d7165b3b4aa4c705dbe530a54628c99 Mon Sep 17 00:00:00 2001
From: Marc Alexander <admin@m-a-styles.de>
Date: Tue, 2 Jun 2020 07:43:27 +0200
Subject: [PATCH 1/9] [ticket/16507] Fix incorrect call to
 sphinx_clean_search_string()

PHPBB3-16507
---
 phpBB/phpbb/search/fulltext_sphinx.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index d37f26856c..e806929399 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -711,7 +711,7 @@ class fulltext_sphinx
 		$this->sphinx->SetFilter('deleted', array(0));
 
 		$this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page));
-		$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
+		$result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
 
 		// Could be connection to localhost:9312 failed (errno=111,
 		// msg=Connection refused) during rotate, retry if so
@@ -719,7 +719,7 @@ class fulltext_sphinx
 		while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
 		{
 			usleep(SPHINX_CONNECT_WAIT_TIME);
-			$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
+			$result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
 		}
 
 		if ($this->sphinx->GetLastError())
@@ -742,7 +742,7 @@ class fulltext_sphinx
 			$start = floor(($result_count - 1) / $per_page) * $per_page;
 
 			$this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page));
-			$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
+			$result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
 
 			// Could be connection to localhost:9312 failed (errno=111,
 			// msg=Connection refused) during rotate, retry if so
@@ -750,7 +750,7 @@ class fulltext_sphinx
 			while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
 			{
 				usleep(SPHINX_CONNECT_WAIT_TIME);
-				$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
+				$result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
 			}
 		}
 

From 6a24d7218305d96cee66934a32280f0b6d44a504 Mon Sep 17 00:00:00 2001
From: Marc Alexander <admin@m-a-styles.de>
Date: Tue, 2 Jun 2020 21:22:27 +0200
Subject: [PATCH 2/9] [ticket/16511] Fix typo when checking for
 phpbb_delete_users_pms()

PHPBB3-16511
---
 phpBB/includes/functions_user.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index d39dbed5ff..58de5ab0de 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -760,7 +760,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
 	$db->sql_query($sql);
 
 	// Clean the private messages tables from the user
-	if (!function_exists('phpbb_delete_user_pms'))
+	if (!function_exists('phpbb_delete_users_pms'))
 	{
 		include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
 	}

From 8ef8df4b18e9f4ae258cd9fd6fb673e8a6c59f37 Mon Sep 17 00:00:00 2001
From: kasimi <mail@kasimi.net>
Date: Tue, 2 Jun 2020 18:57:55 +0200
Subject: [PATCH 3/9] [ticket/16510] Added config values to schema_data.sql

PHPBB3-16510
---
 phpBB/install/schemas/schema_data.sql | 66 +++++++++++++++++----------
 1 file changed, 41 insertions(+), 25 deletions(-)

diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 07a0d93f62..12e8db735c 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -12,20 +12,21 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '1'
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_gravatar', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote_upload', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_board_notifications', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_cdn', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_password_reset', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_forum_notify', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_live_searches', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_mass_pm', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', 'USERNAME_CHARS_ANY');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_password_reset', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_report', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_flash', '1');
@@ -71,21 +72,22 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_plugin', 'core.captcha.plugins.nogd');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_foreground_noise', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_x_grid', '25');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_y_grid', '25');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_wave', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_3d_noise', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_fonts', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('confirm_refresh', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_foreground_noise', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_wave', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_x_grid', '25');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_y_grid', '25');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_plugin', 'core.captcha.plugins.nogd');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_attachment_content', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('confirm_refresh', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('contact_admin_form_enable', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_notice', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable', '0');
@@ -95,12 +97,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('database_gc', '604
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('dbms_version', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_subject', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('extension_force_unstable', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_force_sender', '0');
@@ -109,20 +110,25 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_accurate_pm_button', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_board_notifications', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_queue_trigger', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_update_hashes', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('extension_force_unstable', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_enable', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_forum', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_http_auth', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_item_statistics', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_post', '15');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_topic', '10');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_forum', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums_limit', '15');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_topics', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_topics_limit', '15');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topic', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_new', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_active', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_item_statistics', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_new', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval', '15');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('force_server_vars', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_lifetime', '7200');
@@ -161,13 +167,16 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_max', '50');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_time', '21600');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_use_forwarded', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_allow_self_signed', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', '');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_package_size', '20');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_use_ssl', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_verify_peer', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_verify_peer_name', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_email', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_password', '');
@@ -187,6 +196,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofi
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_font_awesome_url', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1');
@@ -224,13 +234,13 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_height
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_width', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', '3');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_post_chars', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_post_limit', '3');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_group_default', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_post_limit', '3');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PASS_TYPE_ANY');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('plupload_salt', 'phpbb_plupload');
@@ -241,19 +251,20 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_recipients'
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '60');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_trigger_posts', '3');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_expire_days', '30');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_gc', '86400');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('remote_upload_verify', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', '\phpbb\search\fulltext_native');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', '\phpbb\search\fulltext_native');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_downloads', '0');
@@ -263,21 +274,24 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol',
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', '3600');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_text', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', '');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_allow_self_signed', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_auth_method', 'PLAIN');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
-INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('smtp_password', '', 1);
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');
-INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('smtp_username', '', 1);
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_verify_peer', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_verify_peer_name', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('update_hashes_last_cron', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('update_hashes_lock', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
@@ -305,6 +319,8 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1);
+INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('smtp_password', '', 1);
+INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('smtp_username', '', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('warnings_last_gc', '0', 1);
 

From 6cab65efb021550fb77e5d26b7d71c5cb81135e7 Mon Sep 17 00:00:00 2001
From: kasimi <mail@kasimi.net>
Date: Tue, 2 Jun 2020 19:34:19 +0200
Subject: [PATCH 4/9] [ticket/16510] Added more config values

PHPBB3-16510
---
 phpBB/install/schemas/schema_data.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 12e8db735c..2416ffa26e 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -288,6 +288,16 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_verify_peer',
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_verify_peer_name', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.pm_text_cron_interval', '10');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.pm_text_last_cron', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.poll_option_cron_interval', '10');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.poll_option_last_cron', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.poll_title_cron_interval', '10');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.poll_title_last_cron', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.post_text_cron_interval', '10');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.post_text_last_cron', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.user_signature_cron_interval', '10');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('text_reparser.user_signature_last_cron', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('update_hashes_last_cron', '0');
@@ -316,6 +326,7 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_s
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('read_notification_last_gc', '0', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1);
+INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('reparse_lock', '0', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1);
 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1);

From e9bea9dec0249722d40d63ed6a80091dd08d29ec Mon Sep 17 00:00:00 2001
From: kasimi <mail@kasimi.net>
Date: Wed, 3 Jun 2020 12:38:05 +0200
Subject: [PATCH 5/9] [ticket/16510] Added feed_limit to schema_data.sql

PHPBB3-16510
---
 phpBB/install/schemas/schema_data.sql | 1 +
 1 file changed, 1 insertion(+)

diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 2416ffa26e..ed6dc19976 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -119,6 +119,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_enable', '1')
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_forum', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_http_auth', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_item_statistics', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit', '10');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_post', '15');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_topic', '10');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall', '1');

From 65d825b62c2db5b257a4d45e6aa168f30cc1a8cd Mon Sep 17 00:00:00 2001
From: kasimi <mail@kasimi.net>
Date: Wed, 3 Jun 2020 12:39:04 +0200
Subject: [PATCH 6/9] [ticket/16510] Added migration that adds missing config
 entries

PHPBB3-16510
---
 .../data/v32x/add_missing_config.php          | 64 +++++++++++++++++++
 phpBB/phpbb/db/migrator.php                   |  2 +-
 2 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 phpBB/phpbb/db/migration/data/v32x/add_missing_config.php

diff --git a/phpBB/phpbb/db/migration/data/v32x/add_missing_config.php b/phpBB/phpbb/db/migration/data/v32x/add_missing_config.php
new file mode 100644
index 0000000000..53db984953
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v32x/add_missing_config.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @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\v32x;
+
+use phpbb\db\migration\migration_interface;
+use phpbb\db\migrator;
+
+class add_missing_config extends \phpbb\db\migration\container_aware_migration
+{
+	static public function depends_on()
+	{
+		return [
+			'\phpbb\db\migration\data\v32x\v329',
+		];
+	}
+
+	public function update_data()
+	{
+		$migration_classes = [
+			'\phpbb\db\migration\data\v30x\release_3_0_3_rc1',
+			'\phpbb\db\migration\data\v30x\release_3_0_6_rc1',
+			'\phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options',
+			'\phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options',
+			'\phpbb\db\migration\data\v31x\update_hashes',
+			'\phpbb\db\migration\data\v320\font_awesome_update',
+			'\phpbb\db\migration\data\v320\text_reparser',
+			'\phpbb\db\migration\data\v32x\cookie_notice_p2',
+		];
+
+		/** @var migrator $migrator */
+		$migrator = $this->container->get('migrator');
+
+		$update_data = [];
+
+		foreach ($migration_classes as $migration_class)
+		{
+			/** @var migration_interface $migration */
+			$migration = $migrator->get_migration($migration_class);
+
+			$migration_update_data = $migration->update_data();
+
+			foreach ($migration_update_data as $entry)
+			{
+				if ($entry[0] == 'config.add')
+				{
+					$update_data[] = $entry;
+				}
+			}
+		}
+
+		return $update_data;
+	}
+}
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index 2b0c66fc58..f6f6a58639 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -948,7 +948,7 @@ class migrator
 	* @param string $name Name of the migration
 	* @return \phpbb\db\migration\migration
 	*/
-	protected function get_migration($name)
+	public function get_migration($name)
 	{
 		$migration = new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);
 

From 0ac066aac731f659773c25bcb69c500132917068 Mon Sep 17 00:00:00 2001
From: kasimi <mail@kasimi.net>
Date: Wed, 3 Jun 2020 12:44:28 +0200
Subject: [PATCH 7/9] [ticket/16510] Make sure config entry exists before
 updating it

PHPBB3-16510
---
 .../data/v32x/font_awesome_update_cdn.php     |  2 +-
 ...font_awesome_update_cdn_fix_depends_on.php | 44 +++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn_fix_depends_on.php

diff --git a/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn.php b/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn.php
index bb477b8437..f7d45c9d5f 100644
--- a/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn.php
+++ b/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn.php
@@ -23,7 +23,7 @@ class font_awesome_update_cdn extends \phpbb\db\migration\migration
 	static public function depends_on()
 	{
 		return [
-			'\phpbb\db\migration\data\v32x\v329',
+			'\phpbb\db\migration\data\v32x\add_missing_config',
 		];
 	}
 
diff --git a/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn_fix_depends_on.php b/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn_fix_depends_on.php
new file mode 100644
index 0000000000..4ab9e3f3b7
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v32x/font_awesome_update_cdn_fix_depends_on.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @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\v32x;
+
+class font_awesome_update_cdn_fix_depends_on extends \phpbb\db\migration\migration
+{
+	static public function depends_on()
+	{
+		return [
+			'\phpbb\db\migration\data\v32x\font_awesome_update_cdn',
+			'\phpbb\db\migration\data\v32x\add_missing_config',
+		];
+	}
+
+	public function update_data()
+	{
+		return [
+			['custom', [[$this, 'fix_depends_on']]],
+		];
+	}
+
+	public function fix_depends_on()
+	{
+		$migration_class = '\phpbb\db\migration\data\v32x\font_awesome_update_cdn';
+		$migration_depends_on = $migration_class::depends_on();
+
+		$sql = 'UPDATE ' . $this->table_prefix . "migrations
+			SET migration_depends_on = '" . $this->db->sql_escape(serialize($migration_depends_on)) . "'
+			WHERE migration_name = ' . $migration_class . '";
+
+		$this->db->sql_query($sql);
+	}
+}

From e19dac0658683ea6941f77d2626983f3a386e3de Mon Sep 17 00:00:00 2001
From: rxu <rxu@mail.ru>
Date: Mon, 1 Jun 2020 17:14:03 +0700
Subject: [PATCH 8/9] [ticket/16505] Fix use of count() on non-Countable

PHPBB3-16505
---
 phpBB/phpbb/language/language.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php
index 51e6d0b185..cb21d50ea3 100644
--- a/phpBB/phpbb/language/language.php
+++ b/phpBB/phpbb/language/language.php
@@ -292,9 +292,10 @@ class language
 	 *
 	 * @return string
 	 */
-	public function lang_array($key, $args = array())
+	public function lang_array($key, $args = [])
 	{
 		$lang = $this->lang_raw($key);
+		$args = (array) $args;
 
 		if ($lang === $key)
 		{

From 97a41142651ef8a847358b85ba1db1b11be18e74 Mon Sep 17 00:00:00 2001
From: rxu <rxu@mail.ru>
Date: Mon, 1 Jun 2020 18:17:26 +0700
Subject: [PATCH 9/9] [ticket/16505] Forbid using of non-array as a second
 argument

PHPBB3-16505
---
 phpBB/phpbb/language/language.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php
index cb21d50ea3..1f6300fb70 100644
--- a/phpBB/phpbb/language/language.php
+++ b/phpBB/phpbb/language/language.php
@@ -292,10 +292,9 @@ class language
 	 *
 	 * @return string
 	 */
-	public function lang_array($key, $args = [])
+	public function lang_array($key, array $args = [])
 	{
 		$lang = $this->lang_raw($key);
-		$args = (array) $args;
 
 		if ($lang === $key)
 		{