--- a/.htaccess
+++ b/.htaccess
@@ -2,6 +2,16 @@
 RewriteEngine on
 
 #
+# Uncomment the statement below if URL rewriting doesn't
+# work properly. If you installed phpBB in a subdirectory
+# of your site, properly set the argument for the statement.
+# e.g.: if your domain is test.com and you installed phpBB
+# in http://www.test.com/phpBB/index.php you have to set
+# the statement RewriteBase /phpBB/
+#
+#RewriteBase /
+
+#
 # Uncomment the statement below if you want to make use of
 # HTTP authentication and it does not already work.
 # This could be required if you are for example using PHP via Apache CGI.
--- a/adm/style/acp_users_prefs.html
+++ b/adm/style/acp_users_prefs.html
@@ -52,7 +52,7 @@
 	<dl> 
 		<dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
 		<dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd>
-		<dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" /></div></dd>
+		<dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" /></div></dd>
 	</dl>
 	<!-- EVENT acp_users_prefs_personal_append -->
 	</fieldset>
--- a/adm/style/install_footer.html
+++ b/adm/style/install_footer.html
@@ -12,7 +12,7 @@
 </div>
 
 <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js">\x3C/script>');</script><!-- ENDIF -->
 <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
 <!-- INCLUDEJS admin.js -->
 {$SCRIPTS}
--- a/adm/style/overall_footer.html
+++ b/adm/style/overall_footer.html
@@ -34,7 +34,7 @@
 </div>
 
 <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
 <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
 <!-- INCLUDEJS ajax.js -->
 <!-- INCLUDEJS admin.js -->
--- a/adm/style/simple_footer.html
+++ b/adm/style/simple_footer.html
@@ -17,7 +17,7 @@
 </div>
 
 <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
 <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
 
 <!-- EVENT acp_simple_footer_after -->
--- a/assets/javascript/core.js
+++ b/assets/javascript/core.js
@@ -1029,7 +1029,7 @@ phpbb.resizeTextArea = function($items, options) {
 
 	function autoResize(item) {
 		function setHeight(height) {
-			height += parseInt($item.css('height'), 10) - $item.height();
+			height += parseInt($item.css('height'), 10) - $item.innerHeight();
 			$item
 				.css({ height: height + 'px', resize: 'none' })
 				.addClass('auto-resized');
@@ -1048,7 +1048,7 @@ phpbb.resizeTextArea = function($items, options) {
 				configuration.maxHeight
 			),
 			$item = $(item),
-			height = parseInt($item.height(), 10),
+			height = parseInt($item.innerHeight(), 10),
 			scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
 
 		if (height < 0) {
--- a/bin/phpbbcli.php
+++ b/bin/phpbbcli.php
@@ -59,6 +59,8 @@ $phpbb_container->get('request')->enable_super_globals();
 require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
 
 $user = $phpbb_container->get('user');
+$user->data['user_id'] = ANONYMOUS;
+$user->ip = '127.0.0.1';
 $user->add_lang('acp/common');
 $user->add_lang('cli');
 
--- a/composer.json
+++ b/composer.json
@@ -51,5 +51,10 @@
 		"symfony/finder": "2.3.*",
 		"symfony/http-foundation": "2.3.*",
 		"symfony/process": "2.3.*"
+	},
+	"extra": {
+		"branch-alias": {
+			"dev-master": "3.1.x-dev"
+		}
 	}
 }
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "5864f5064e1ca81dd9817ee2674b5dfd",
+    "hash": "33fa9de480a8a9c8f7e3f2926cd4c034",
     "packages": [
         {
             "name": "lusitanian/oauth",
@@ -2307,7 +2307,7 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=5.3.3"
+        "php": ">=5.3.3,<7.0"
     },
     "platform-dev": []
 }
--- a/docs/CHANGELOG.html
+++ b/docs/CHANGELOG.html
@@ -49,6 +49,7 @@
 <ol>
 	<li><a href="#changelog">Changelog</a>
 	<ul>
+		<li><a href="#v317pl1">Changes since 3.1.7-PL1</a></li>
 		<li><a href="#v317">Changes since 3.1.7</a></li>
 		<li><a href="#v316">Changes since 3.1.6</a></li>
 		<li><a href="#v315">Changes since 3.1.5</a></li>
@@ -113,7 +114,43 @@
 	<div class="paragraph">
 		<div class="inner">
 
-		<div class="content">
+<div class="content">
+
+			<a name="v317pl1"></a><h3>Changes since 3.1.7-PL1</h3>
+
+	<h4>Bug</h4>
+	<ul>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12441">PHPBB3-12441</a>] - Database-size in ACP missing after update MariaDB from 5.5 to 10.0</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12618">PHPBB3-12618</a>] - Extension Version Check does not support https</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13180">PHPBB3-13180</a>] - Increase the field size of date format to allow more syntax for other calendars</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13908">PHPBB3-13908</a>] - After clause in migration add_column schema tool not honored</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14046">PHPBB3-14046</a>] - Instant message (jabber) dialog says message sent on the creation screen</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14303">PHPBB3-14303</a>] - Some changes for UTF-8 variant on language pack?</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14374">PHPBB3-14374</a>] - Update dynamically generated jquery CDN script tag</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14386">PHPBB3-14386</a>] - open_basedir restriction in effect with remote upload avatar</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14387">PHPBB3-14387</a>] - Extend avatar-driver by extension in ACP not possible</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14394">PHPBB3-14394</a>] - Only purge cache in functional tests if necessary</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14396">PHPBB3-14396</a>] - Use VCHAR_UNI instead of VCHAR for user_dateformat</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14397">PHPBB3-14397</a>] - Fix @since tag in event 'core.ucp_prefs_view_after'</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14403">PHPBB3-14403</a>] - phpbb\log should still work even when no user data is given</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14407">PHPBB3-14407</a>] - Users not being removed from Newly Registered Users group</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14409">PHPBB3-14409</a>] - Update session page info before displaying online list</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14411">PHPBB3-14411</a>] - Delete permanently is not working as it should be</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14423">PHPBB3-14423</a>] - Display database size for Aria storage engine</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14425">PHPBB3-14425</a>] - Database tests do not allow using socket</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14427">PHPBB3-14427</a>] - Memberlist Display Wrong</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14433">PHPBB3-14433</a>] - Functional tests fail for extensions</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14439">PHPBB3-14439</a>] - Error page shown in Manage users -&gt; Anonymous -&gt; Select Form -&gt; Avatar when board wide all avatar settings are disabled</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14467">PHPBB3-14467</a>] - Automatic resize of textarea calculates wrong height</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14475">PHPBB3-14475</a>] - Do not log removal of users from newly registered group</li>
+	</ul>
+	<h4>Improvement</h4>
+	<ul>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14289">PHPBB3-14289</a>] - Add events in navbar header</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14356">PHPBB3-14356</a>] - Add template events to viewtopic around back2top link</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14412">PHPBB3-14412</a>] - Comment fixes for PHPDoc in the events</li>
+		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14458">PHPBB3-14458</a>] - Explicitly state RewriteBase into .htaccess root file</li>
+	</ul>
 
 			<a name="v317"></a><h3>Changes since 3.1.7</h3>
 
--- a/docs/events.md
+++ b/docs/events.md
@@ -1100,6 +1100,20 @@ navbar_header_quick_links_before
 * Since: 3.1.0-RC2
 * Purpose: Add links to the top of the quick-links drop-down menu in the header
 
+navbar_header_user_profile_append
+===
+* Locations:
+    + styles/prosilver/template/navbar_header.html
+* Since: 3.1.8-RC1
+* Purpose: Add links to the right of the user drop down area
+
+navbar_header_user_profile_prepend
+===
+* Locations:
+    + styles/prosilver/template/navbar_header.html
+* Since: 3.1.8-RC1
+* Purpose: Add links to the left of the notification area
+
 navbar_header_username_append
 ===
 * Locations:
@@ -2441,6 +2455,38 @@ viewtopic_body_post_subject_before
 * Since: 3.1.7-RC1
 * Purpose: Add data before post icon and subject
 
+viewtopic_body_postrow_back2top_after
+===
+* Locations:
+    + styles/prosilver/template/viewtopic_body.html
+    + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom after the back to top link 
+
+viewtopic_body_postrow_back2top_append
+===
+* Locations:
+    + styles/prosilver/template/viewtopic_body.html
+    + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom directly after the back to top link 
+
+viewtopic_body_postrow_back2top_before
+===
+* Locations:
+    + styles/prosilver/template/viewtopic_body.html
+    + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom before the back to top link 
+
+viewtopic_body_postrow_back2top_prepend
+===
+* Locations:
+    + styles/prosilver/template/viewtopic_body.html
+    + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom directly before the back to top link 
+
 viewtopic_body_postrow_custom_fields_after
 ===
 * Locations:
--- a/includes/acp/acp_bbcodes.php
+++ b/includes/acp/acp_bbcodes.php
@@ -370,7 +370,7 @@ class acp_bbcodes
 		*
 		* @event core.acp_bbcodes_display_form
 		* @var	string	action			Type of the action: modify|create
-		* @var	string	sql_ary			The SQL array to get custom bbcode data
+		* @var	array	sql_ary			The SQL array to get custom bbcode data
 		* @var	array	template_data	Array with form template data
 		* @var	string	u_action		The u_action link
 		* @since 3.1.0-a3
--- a/includes/acp/acp_extensions.php
+++ b/includes/acp/acp_extensions.php
@@ -535,7 +535,7 @@ class acp_extensions
 
 		$version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user);
 		$version_helper->set_current_version($meta['version']);
-		$version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']);
+		$version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename'], isset($version_check['ssl']) ? $version_check['ssl'] : false);
 		$version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null);
 
 		return $updates = $version_helper->get_suggested_updates($force_update, $force_cache);
--- a/includes/acp/acp_groups.php
+++ b/includes/acp/acp_groups.php
@@ -672,9 +672,8 @@ class acp_groups
 						$driver = $phpbb_avatar_manager->get_driver($current_driver);
 
 						$avatars_enabled = true;
-						$config_name = $phpbb_avatar_manager->get_driver_config_name($driver);
 						$template->set_filenames(array(
-							'avatar' => "acp_avatar_options_{$config_name}.html",
+							'avatar' => $driver->get_acp_template_name(),
 						));
 
 						if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error))
--- a/includes/acp/acp_users.php
+++ b/includes/acp/acp_users.php
@@ -1587,7 +1587,7 @@ class acp_users
 				if ($submit)
 				{
 					$error = validate_data($data, array(
-						'dateformat'	=> array('string', false, 1, 30),
+						'dateformat'	=> array('string', false, 1, 64),
 						'lang'			=> array('match', false, '#^[a-z_\-]{2,}$#i'),
 						'tz'			=> array('timezone'),
 
@@ -1878,9 +1878,8 @@ class acp_users
 						$driver = $phpbb_avatar_manager->get_driver($current_driver);
 
 						$avatars_enabled = true;
-						$config_name = $phpbb_avatar_manager->get_driver_config_name($driver);
 						$template->set_filenames(array(
-							'avatar' => "acp_avatar_options_{$config_name}.html",
+							'avatar' => $driver->get_acp_template_name(),
 						));
 
 						if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))
@@ -1900,8 +1899,12 @@ class acp_users
 					}
 				}
 
-				// Replace "error" strings with their real, localised form
-				$error = $phpbb_avatar_manager->localize_errors($user, $error);
+				// Avatar manager is not initialized if avatars are disabled
+				if (isset($phpbb_avatar_manager))
+				{
+					// Replace "error" strings with their real, localised form
+					$error = $phpbb_avatar_manager->localize_errors($user, $error);
+				}
 
 				$avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true);
 
--- a/includes/constants.php
+++ b/includes/constants.php
@@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
 */
 
 // phpBB Version
-define('PHPBB_VERSION', '3.1.7-pl1');
+define('PHPBB_VERSION', '3.1.8');
 
 // QA-related
 // define('PHPBB_QA', 1);
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -4283,7 +4283,7 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
 		* @var	string	item			Restrict online users to a certain
 		*								session item, e.g. forum for
 		*								session_forum_id
-		* @var	string	sql_ary			SQL query to obtain users online data
+		* @var	array	sql_ary			SQL query array to obtain users online data
 		* @since 3.1.4-RC1
 		* @changed 3.1.7-RC1			Change sql query into array and adjust var accordingly. Allows extension authors the ability to adjust the sql_ary.
 		*/
@@ -4969,6 +4969,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
 		}
 	}
 
+	$user->update_session_infos();
+
 	// Generate logged in/logged out status
 	if ($user->data['user_id'] != ANONYMOUS)
 	{
@@ -5395,8 +5397,6 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
 		return;
 	}
 
-	$user->update_session_infos();
-
 	phpbb_check_and_display_sql_report($request, $auth, $db);
 
 	$template->assign_vars(array(
--- a/includes/functions_acp.php
+++ b/includes/functions_acp.php
@@ -55,6 +55,8 @@ function adm_page_header($page_title)
 		return;
 	}
 
+	$user->update_session_infos();
+
 	// gzip_compression
 	if ($config['gzip_compress'])
 	{
@@ -164,8 +166,6 @@ function adm_page_footer($copyright_html = true)
 		return;
 	}
 
-	$user->update_session_infos();
-
 	phpbb_check_and_display_sql_report($request, $auth, $db);
 
 	$template->assign_vars(array(
--- a/includes/functions_admin.php
+++ b/includes/functions_admin.php
@@ -3101,9 +3101,9 @@ function get_database_size()
 			{
 				$version = $row['mysql_version'];
 
-				if (preg_match('#(3\.23|[45]\.)#', $version))
+				if (preg_match('#(3\.23|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria)#', $version))
 				{
-					$db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name();
+					$db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name();
 
 					$sql = 'SHOW TABLE STATUS
 						FROM ' . $db_name;
@@ -3112,7 +3112,7 @@ function get_database_size()
 					$database_size = 0;
 					while ($row = $db->sql_fetchrow($result))
 					{
-						if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB')))
+						if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB' || $row['Engine'] == 'Aria')))
 						{
 							if ($table_prefix != '')
 							{
--- a/includes/functions_upload.php
+++ b/includes/functions_upload.php
@@ -776,9 +776,18 @@ class fileupload
 
 		$url = parse_url($upload_url);
 
+		$default_port = 80;
+		$hostname = $url['host'];
+
+		if ($url['scheme'] == 'https')
+		{
+			$default_port = 443;
+			$hostname = 'tls://' . $url['host'];
+		}
+
 		$host = $url['host'];
 		$path = $url['path'];
-		$port = (!empty($url['port'])) ? (int) $url['port'] : 80;
+		$port = (!empty($url['port'])) ? (int) $url['port'] : $default_port;
 
 		$upload_ary['type'] = 'application/octet-stream';
 
@@ -818,7 +827,7 @@ class fileupload
 		$errno = 0;
 		$errstr = '';
 
-		if (!($fsock = @fsockopen($host, $port, $errno, $errstr)))
+		if (!($fsock = @fsockopen($hostname, $port, $errno, $errstr)))
 		{
 			$file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']);
 			return $file;
@@ -919,7 +928,7 @@ class fileupload
 			return $file;
 		}
 
-		$tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache';
+		$tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? sys_get_temp_dir() : $phpbb_root_path . 'cache';
 		$filename = tempnam($tmp_path, unique_id() . '-');
 
 		if (!($fp = @fopen($filename, 'wb')))
--- a/includes/functions_user.php
+++ b/includes/functions_user.php
@@ -2831,7 +2831,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
 *
 * @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
 */
-function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
+function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $log_action = true)
 {
 	global $db, $auth, $config, $phpbb_dispatcher, $phpbb_container;
 
@@ -2966,16 +2966,19 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
 	$vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary');
 	extract($phpbb_dispatcher->trigger_event('core.group_delete_user_after', compact($vars)));
 
-	if (!$group_name)
+	if ($log_action)
 	{
-		$group_name = get_group_name($group_id);
-	}
+		if (!$group_name)
+		{
+			$group_name = get_group_name($group_id);
+		}
 
-	$log = 'LOG_GROUP_REMOVE';
+		$log = 'LOG_GROUP_REMOVE';
 
-	if ($group_name)
-	{
-		add_log('admin', $log, $group_name, implode(', ', $username_ary));
+		if ($group_name)
+		{
+			add_log('admin', $log, $group_name, implode(', ', $username_ary));
+		}
 	}
 
 	group_update_listings($group_id);
@@ -3619,8 +3622,8 @@ function remove_newly_registered($user_id, $user_data = false)
 	}
 
 	// We need to call group_user_del here, because this function makes sure everything is correctly changed.
-	// A downside for a call within the session handler is that the language is not set up yet - so no log entry
-	group_user_del($group_id, $user_id);
+	// Force function to not log the removal of users from newly registered users group
+	group_user_del($group_id, $user_id, false, false, false);
 
 	// Set user_new to 0 to let this not be triggered again
 	$sql = 'UPDATE ' . USERS_TABLE . '
--- a/includes/mcp/mcp_front.php
+++ b/includes/mcp/mcp_front.php
@@ -54,8 +54,8 @@ function mcp_front_view($id, $mode, $action)
 			* Allow altering the query to get the number of unapproved posts
 			*
 			* @event core.mcp_front_queue_unapproved_total_before
-			* @var	int		sql_ary						Query to get the total number of unapproved posts
-			* @var	array	forum_list					List of forums to look for unapproved posts
+			* @var	array	sql_ary			Query array to get the total number of unapproved posts
+			* @var	array	forum_list		List of forums to look for unapproved posts
 			* @since 3.1.5-RC1
 			*/
 			$vars = array('sql_ary', 'forum_list');
@@ -179,7 +179,7 @@ function mcp_front_view($id, $mode, $action)
 			* Alter sql query to count the number of reported posts
 			*
 			* @event core.mcp_front_reports_count_query_before
-			* @var	int		sql				The query string used to get the number of reports that exist
+			* @var	string	sql				The query string used to get the number of reports that exist
 			* @var	array	forum_list		List of forums that contain the posts
 			* @since 3.1.5-RC1
 			*/
@@ -226,8 +226,8 @@ function mcp_front_view($id, $mode, $action)
 				* Alter sql query to get latest reported posts
 				*
 				* @event core.mcp_front_reports_listing_query_before
-				* @var	int		sql_ary						Associative array with the query to be executed
-				* @var	array	forum_list					List of forums that contain the posts
+				* @var	array	sql_ary			Associative array with the query to be executed
+				* @var	array	forum_list		List of forums that contain the posts
 				* @since 3.1.0-RC3
 				*/
 				$vars = array('sql_ary', 'forum_list');
--- a/includes/mcp/mcp_reports.php
+++ b/includes/mcp/mcp_reports.php
@@ -95,7 +95,7 @@ class mcp_reports
 				*
 				* @event core.mcp_reports_report_details_query_before
 				* @var	array	sql_ary			The array in the format of the query builder with the query
-				* @var	mixed	forum_id		The forum_id, the number in the f GET parameter
+				* @var	int		forum_id		The forum_id, the number in the f GET parameter
 				* @var	int		post_id			The post_id of the report being viewed (if 0, it is meaningless)
 				* @var	int		report_id		The report_id of the report being viewed
 				* @since 3.1.5-RC1
@@ -118,10 +118,10 @@ class mcp_reports
 				*
 				* @event core.mcp_reports_report_details_query_after
 				* @var	array	sql_ary		The array in the format of the query builder with the query that had been executted
-				* @var	mixed	forum_id	The forum_id, the number in the f GET parameter
+				* @var	int		forum_id	The forum_id, the number in the f GET parameter
 				* @var	int		post_id		The post_id of the report being viewed (if 0, it is meaningless)
 				* @var	int		report_id	The report_id of the report being viewed
-				* @var	int		report		The query's resulting row.
+				* @var	array	report		The query's resulting row.
 				* @since 3.1.5-RC1
 				*/
 				$vars = array(
--- a/includes/ucp/ucp_prefs.php
+++ b/includes/ucp/ucp_prefs.php
@@ -86,7 +86,7 @@ class ucp_prefs
 					}
 
 					$error = array_merge(validate_data($data, array(
-						'dateformat'	=> array('string', false, 1, 30),
+						'dateformat'	=> array('string', false, 1, 64),
 						'lang'			=> array('language_iso_name'),
 						'tz'			=> array('timezone'),
 					)), $error);
@@ -368,6 +368,49 @@ class ucp_prefs
 					${'s_sort_' . $sort_option . '_dir'} .= '</select>';
 				}
 
+				/**
+				* Run code before view form is displayed
+				*
+				* @event core.ucp_prefs_view_after
+				* @var	bool	submit				Do we display the form only
+				*									or did the user press submit
+				* @var	array	data				Array with current ucp options data
+				* @var	array	sort_dir_text		Array with sort dir language strings
+				* @var	array	limit_topic_days	Topic ordering options
+				* @var	array	sort_by_topic_text	Topic ordering language strings
+				* @var	array	sort_by_topic_sql	Topic ordering sql
+				* @var	array	limit_post_days		Post ordering options
+				* @var	array	sort_by_post_text	Post ordering language strings
+				* @var	array	sort_by_post_sql	Post ordering sql
+				* @var	array	_options			Sort options
+				* @var	string	s_limit_topic_days	Sort limit topic by days select box
+				* @var	string	s_sort_topic_key	Sort topic key select box
+				* @var	string	s_sort_topic_dir	Sort topic dir select box
+				* @var	string	s_limit_post_days	Sort limit post by days select box
+				* @var	string	s_sort_post_key		Sort post key select box
+				* @var	string	s_sort_post_dir		Sort post dir select box
+				* @since 3.1.8-RC1
+				*/
+				$vars = array(
+					'submit',
+					'data',
+					'sort_dir_text',
+					'limit_topic_days',
+					'sort_by_topic_text',
+					'sort_by_topic_sql',
+					'limit_post_days',
+					'sort_by_post_text',
+					'sort_by_post_sql',
+					'_options',
+					's_limit_topic_days',
+					's_sort_topic_key',
+					's_sort_topic_dir',
+					's_limit_post_days',
+					's_sort_post_key',
+					's_sort_post_dir',
+				);
+				extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_after', compact($vars)));
+
 				$template->assign_vars(array(
 					'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '',
 
--- a/language/en/app.php
+++ b/language/en/app.php
@@ -44,5 +44,5 @@ $lang = array_merge($lang, array(
 	'CONTROLLER_ARGUMENT_VALUE_MISSING'	=> 'Missing value for argument #%1$s: <strong>%3$s</strong> in class <strong>%2$s</strong>',
 	'CONTROLLER_NOT_SPECIFIED'			=> 'No controller has been specified.',
 	'CONTROLLER_METHOD_NOT_SPECIFIED'	=> 'No method was specified for the controller.',
-	'CONTROLLER_SERVICE_UNDEFINED'		=> 'The service for controller "<strong>%s</strong>" is not defined in ./config/services.yml.',
+	'CONTROLLER_SERVICE_UNDEFINED'		=> 'The service for controller “<strong>%s</strong>” is not defined in ./config/services.yml.',
 ));
--- a/language/en/help_bbcode.php
+++ b/language/en/help_bbcode.php
@@ -73,11 +73,11 @@ $help = array(
 	),
 	array(
 		0 => 'Creating an Unordered list',
-		1 => 'BBCode supports two types of lists, unordered and ordered. They are essentially the same as their HTML equivalents. An unordered list outputs each item in your list sequentially one after the other indenting each with a bullet character. To create an unordered list you use <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul>'
+		1 => 'BBCode supports two types of lists, unordered and ordered. They are essentially the same as their HTML equivalents. An unordered list outputs each item in your list sequentially one after the other indenting each with a bullet character. To create an unordered list you use <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul><br />Alternatively you can specify the list’s bullet style using <strong>[list=disc][/list]</strong>, <strong>[list=circle][/list]</strong>, or <strong>[list=square][/list]</strong>.'
 	),
 	array(
 		0 => 'Creating an Ordered list',
-		1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
+		1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=A]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: upper-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=i]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-roman"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=I]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: upper-roman"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
 	),
 	// This block will switch the FAQ-Questions to the second template column
 	array(
--- a/memberlist.php
+++ b/memberlist.php
@@ -1229,21 +1229,19 @@ switch ($mode)
 		);
 		extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars)));
 
-		// Count the users ...
-		if ($sql_where)
-		{
-			$sql = 'SELECT COUNT(u.user_id) AS total_users
-				FROM ' . USERS_TABLE . " u$sql_from
-				WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")
-				$sql_where";
-			$result = $db->sql_query($sql);
-			$total_users = (int) $db->sql_fetchfield('total_users');
-			$db->sql_freeresult($result);
-		}
-		else
+		$user_types = array(USER_NORMAL, USER_FOUNDER);
+		if ($auth->acl_get('a_user'))
 		{
-			$total_users = $config['num_users'];
+			$user_types[] = USER_INACTIVE;
 		}
+		// Count the users ...
+		$sql = 'SELECT COUNT(u.user_id) AS total_users
+			FROM ' . USERS_TABLE . " u$sql_from
+			WHERE " . $db->sql_in_set('u.user_type', $user_types) . "
+			$sql_where";
+		$result = $db->sql_query($sql);
+		$total_users = (int) $db->sql_fetchfield('total_users');
+		$db->sql_freeresult($result);
 
 		// Build a relevant pagination_url
 		$params = $sort_params = array();
@@ -1409,13 +1407,7 @@ switch ($mode)
 			);
 		}
 
-		$user_types = array(USER_NORMAL, USER_FOUNDER);
-		if ($auth->acl_get('a_user'))
-		{
-			$user_types[] = USER_INACTIVE;
-		}
-
-		$start = $pagination->validate_start($start, $config['topics_per_page'], $config['num_users']);
+		$start = $pagination->validate_start($start, $config['topics_per_page'], $total_users);
 
 		// Get us some users :D
 		$sql = "SELECT u.user_id
--- a/phpbb/avatar/driver/driver.php
+++ b/phpbb/avatar/driver/driver.php
@@ -120,6 +120,22 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
 	}
 
 	/**
+	* {@inheritdoc}
+	*/
+	public function get_config_name()
+	{
+		return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
+	}
+
+	/**
+	* {@inheritdoc}
+	*/
+	public function get_acp_template_name()
+	{
+		return 'acp_avatar_options_' . $this->get_config_name() . '.html';
+	}
+
+	/**
 	* Sets the name of the driver.
 	*
 	* @param string	$name Driver name
--- a/phpbb/avatar/driver/driver_interface.php
+++ b/phpbb/avatar/driver/driver_interface.php
@@ -26,6 +26,13 @@ interface driver_interface
 	public function get_name();
 
 	/**
+	* Returns the config name of the driver. To be used in accessing the CONFIG variables.
+	*
+	* @return string	Config name of driver.
+	*/
+	public function get_config_name();
+
+	/**
 	* Get the avatar url and dimensions
 	*
 	* @param array	$row User data or group data that has been cleaned with
@@ -110,4 +117,11 @@ interface driver_interface
 	* @return string Avatar driver's template name
 	*/
 	public function get_template_name();
+
+	/**
+	* Get the avatar driver's template name (ACP)
+	*
+	* @return string Avatar driver's template name
+	*/
+	public function get_acp_template_name();
 }
--- a/phpbb/avatar/manager.php
+++ b/phpbb/avatar/manager.php
@@ -246,7 +246,7 @@ class manager
 	*/
 	public function is_enabled($driver)
 	{
-		$config_name = $this->get_driver_config_name($driver);
+		$config_name = $driver->get_config_name();
 
 		return $this->config["allow_avatar_{$config_name}"];
 	}
@@ -260,7 +260,7 @@ class manager
 	*/
 	public function get_avatar_settings($driver)
 	{
-		$config_name = $this->get_driver_config_name($driver);
+		$config_name = $driver->get_config_name();
 
 		return array(
 			'allow_avatar_' . $config_name	=> array('lang' => 'ALLOW_' . strtoupper(str_replace('\\', '_', $config_name)),		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
@@ -268,18 +268,6 @@ class manager
 	}
 
 	/**
-	* Get the config name of an avatar driver
-	*
-	* @param object $driver Avatar driver object
-	*
-	* @return string Avatar driver config name
-	*/
-	public function get_driver_config_name($driver)
-	{
-		return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($driver));
-	}
-
-	/**
 	* Replace "error" strings with their real, localized form
 	*
 	* @param \phpbb\user phpBB User object
--- a/phpbb/composer.json
+++ b/phpbb/composer.json
@@ -23,5 +23,10 @@
 	},
 	"require": {
 		"php": ">=5.3.3"
-    }
+	},
+	"extra": {
+		"branch-alias": {
+			"dev-master": "3.1.x-dev"
+		}
+	}
 }
--- /dev/null
+++ b/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php
@@ -0,0 +1,35 @@
+<?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\v31x;
+
+class increase_size_of_dateformat  extends \phpbb\db\migration\migration
+{
+	static public function depends_on()
+	{
+		return array(
+			'\phpbb\db\migration\data\v31x\v317',
+		);
+	}
+
+	public function update_schema()
+	{
+		return array(
+			'change_columns' => array(
+				$this->table_prefix . 'users' => array(
+					'user_dateformat' => array('VCHAR_UNI:64', 'd M Y H:i'),
+				),
+			),
+		);
+	}
+}
--- /dev/null
+++ b/phpbb/db/migration/data/v31x/v318.php
@@ -0,0 +1,31 @@
+<?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\v31x;
+
+class v318 extends \phpbb\db\migration\migration
+{
+	static public function depends_on()
+	{
+		return array(
+			'\phpbb\db\migration\data\v31x\v318rc1',
+		);
+	}
+
+	public function update_data()
+	{
+		return array(
+			array('config.update', array('version', '3.1.8')),
+		);
+	}
+}
--- /dev/null
+++ b/phpbb/db/migration/data/v31x/v318rc1.php
@@ -0,0 +1,32 @@
+<?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\v31x;
+
+class v318rc1 extends \phpbb\db\migration\migration
+{
+	static public function depends_on()
+	{
+		return array(
+			'\phpbb\db\migration\data\v31x\increase_size_of_dateformat',
+			'\phpbb\db\migration\data\v31x\v317pl1',
+		);
+	}
+
+	public function update_data()
+	{
+		return array(
+			array('config.update', array('version', '3.1.8-RC1')),
+		);
+	}
+}
--- a/phpbb/db/tools.php
+++ b/phpbb/db/tools.php
@@ -1533,6 +1533,11 @@ class tools
 					}
 				}
 
+				if (isset($column_data['after']))
+				{
+					$return_array['after'] = $column_data['after'];
+				}
+
 			break;
 
 			case 'oracle':
--- a/phpbb/file_downloader.php
+++ b/phpbb/file_downloader.php
@@ -42,7 +42,7 @@ class file_downloader
 		$this->error_number = 0;
 		$this->error_string = '';
 
-		if ($socket = @fsockopen($host, $port, $this->error_number, $this->error_string, $timeout))
+		if ($socket = @fsockopen(($port == 443 ? 'tls://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout))
 		{
 			@fputs($socket, "GET $directory/$filename HTTP/1.0\r\n");
 			@fputs($socket, "HOST: $host\r\n");
--- a/phpbb/log/log.php
+++ b/phpbb/log/log.php
@@ -229,8 +229,8 @@ class log implements \phpbb\log\log_interface
 		}
 
 		$sql_ary = array(
-			'user_id'		=> $user_id,
-			'log_ip'		=> $log_ip,
+			'user_id'		=> !empty($user_id) ? $user_id : ANONYMOUS,
+			'log_ip'		=> !empty($log_ip) ? $log_ip : '',
 			'log_time'		=> $log_time,
 			'log_operation'	=> $log_operation,
 		);
--- a/phpbb/session.php
+++ b/phpbb/session.php
@@ -1557,7 +1557,7 @@ class session
 
 	public function update_session_infos()
 	{
-		global $db, $request;
+		global $config, $db, $request;
 
 		// No need to update if it's a new session. Informations are already inserted by session_create()
 		if (isset($this->data['session_created']) && $this->data['session_created'])
@@ -1583,6 +1583,8 @@ class session
 
 			$db->sql_return_on_error(false);
 
+			$this->data = array_merge($this->data, $sql_ary);
+
 			if ($this->data['user_id'] != ANONYMOUS && !empty($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])
 			{
 				$this->leave_newly_registered();
--- a/phpbb/version_helper.php
+++ b/phpbb/version_helper.php
@@ -34,6 +34,11 @@ class version_helper
 	protected $file = 'versions.json';
 
 	/**
+	 * @var bool Use SSL or not
+	 */
+	protected $use_ssl = false;
+
+	/**
 	 * @var string Current version installed
 	 */
 	protected $current_version;
@@ -85,13 +90,15 @@ class version_helper
 	 * @param string $host Host (e.g. version.phpbb.com)
 	 * @param string $path Path to file (e.g. /phpbb)
 	 * @param string $file File name (Default: versions.json)
+	 * @param bool $use_ssl Use SSL or not (Default: false)
 	 * @return version_helper
 	 */
-	public function set_file_location($host, $path, $file = 'versions.json')
+	public function set_file_location($host, $path, $file = 'versions.json', $use_ssl = false)
 	{
 		$this->host = $host;
 		$this->path = $path;
 		$this->file = $file;
+		$this->use_ssl = $use_ssl;
 
 		return $this;
 	}
@@ -244,7 +251,7 @@ class version_helper
 	*/
 	public function get_versions($force_update = false, $force_cache = false)
 	{
-		$cache_file = '_versioncheck_' . $this->host . $this->path . $this->file;
+		$cache_file = '_versioncheck_' . $this->host . $this->path . $this->file . $this->use_ssl;
 
 		$info = $this->cache->get($cache_file);
 
@@ -255,7 +262,7 @@ class version_helper
 		else if ($info === false || $force_update)
 		{
 			try {
-				$info = $this->file_downloader->get($this->host, $this->path, $this->file);
+				$info = $this->file_downloader->get($this->host, $this->path, $this->file, $this->use_ssl ? 443 : 80);
 			}
 			catch (\phpbb\exception\runtime_exception $exception)
 			{
--- a/posting.php
+++ b/posting.php
@@ -481,7 +481,7 @@ if ($mode == 'delete' || $mode == 'soft_delete')
 	}
 
 	$delete_reason = $request->variable('delete_reason', '', true);
-	phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $delete_reason);
+	phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete' && !$request->is_set_post('delete_permanent')), $delete_reason);
 	return;
 }
 
--- a/styles/prosilver/style.cfg
+++ b/styles/prosilver/style.cfg
@@ -21,8 +21,8 @@
 # General Information about this style
 name = prosilver
 copyright = © phpBB Limited, 2007
-style_version = 3.1.7
-phpbb_version = 3.1.7
+style_version = 3.1.8
+phpbb_version = 3.1.8
 
 # Defining a different template bitfield
 # template_bitfield = lNg=
--- a/styles/prosilver/template/memberlist_im.html
+++ b/styles/prosilver/template/memberlist_im.html
@@ -9,6 +9,10 @@
 
 	<p>{L_SEND_IM_EXPLAIN}</p>
 
+	<!-- IF S_SENT_JABBER -->
+		<p>{L_IM_SENT_JABBER}</p>
+	<!-- ENDIF -->
+
 	<fieldset>
 	<dl class="fields2">
 		<dt><label>{L_IM_RECIPIENT}{L_COLON}</label></dt>
@@ -24,10 +28,6 @@
 			<dt>&nbsp;</dt>
 			<dd><input class="button1" name="submit" type="submit" value="{L_IM_SEND}" /></dd>
 		</dl>
-		<dl class="fields2">
-			<dt>&nbsp;</dt>
-			<dd>{L_IM_SENT_JABBER}</dd>
-		</dl>
 	<!-- ELSE IF S_NO_SEND_JABBER -->
 		<dl class="fields2">
 			<dt>&nbsp;</dt>
--- a/styles/prosilver/template/navbar_header.html
+++ b/styles/prosilver/template/navbar_header.html
@@ -46,6 +46,7 @@
 		<!-- IF U_MCP --><li class="small-icon icon-mcp" data-last-responsive="true"><a href="{U_MCP}" title="{L_MCP}" role="menuitem">{L_MCP_SHORT}</a></li><!-- ENDIF -->
 
 	<!-- IF S_REGISTERED_USER -->
+		<!-- EVENT navbar_header_user_profile_prepend -->
 		<li id="username_logged_in" class="rightside <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true">
 			<!-- EVENT navbar_header_username_prepend -->
 			<div class="header-profile dropdown-container">
@@ -80,6 +81,7 @@
 				<!-- INCLUDE notification_dropdown.html -->
 			</li>
 		<!-- ENDIF -->
+		<!-- EVENT navbar_header_user_profile_append -->
 	<!-- ELSE -->
 		<li class="small-icon icon-logout rightside"  data-skip-responsive="true"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li>
 		<!-- IF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) -->
--- a/styles/prosilver/template/overall_footer.html
+++ b/styles/prosilver/template/overall_footer.html
@@ -37,7 +37,7 @@
 </div>
 
 <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
 <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
 <!-- INCLUDEJS forum_fn.js -->
 <!-- INCLUDEJS ajax.js -->
--- a/styles/prosilver/template/simple_footer.html
+++ b/styles/prosilver/template/simple_footer.html
@@ -21,7 +21,7 @@
 </div>
 
 <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
 <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
 <!-- INCLUDEJS forum_fn.js -->
 <!-- INCLUDEJS ajax.js -->
--- a/styles/prosilver/template/ucp_prefs_personal.html
+++ b/styles/prosilver/template/ucp_prefs_personal.html
@@ -70,7 +70,7 @@
 				{S_DATEFORMAT_OPTIONS}
 			</select>
 		</dd>
-		<dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="inputbox narrow" style="margin-top: 3px;" /></dd>
+		<dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" class="inputbox narrow" style="margin-top: 3px;" /></dd>
 	</dl>
 	<!-- EVENT ucp_prefs_personal_append -->
 	</fieldset>
--- a/styles/prosilver/template/viewtopic_body.html
+++ b/styles/prosilver/template/viewtopic_body.html
@@ -331,7 +331,9 @@
 
 		</div>
 
-		<div class="back2top"><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
+		<!-- EVENT viewtopic_body_postrow_back2top_before -->
+		<div class="back2top"><!-- EVENT viewtopic_body_postrow_back2top_prepend --><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a><!-- EVENT viewtopic_body_postrow_back2top_append --></div>
+		<!-- EVENT viewtopic_body_postrow_back2top_after -->
 
 		</div>
 	</div>
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer' . '/autoload_real.php';
 
-return ComposerAutoloaderInitf856c46a38122313790aa31708d122a3::getLoader();
+return ComposerAutoloaderInit4c26a5bcff209efe42702c92c38cbf4d::getLoader();
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInitf856c46a38122313790aa31708d122a3
+class ComposerAutoloaderInit4c26a5bcff209efe42702c92c38cbf4d
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitf856c46a38122313790aa31708d122a3
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInitf856c46a38122313790aa31708d122a3', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInit4c26a5bcff209efe42702c92c38cbf4d', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInitf856c46a38122313790aa31708d122a3', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit4c26a5bcff209efe42702c92c38cbf4d', 'loadClassLoader'));
 
         $map = require __DIR__ . '/autoload_namespaces.php';
         foreach ($map as $namespace => $path) {
@@ -44,7 +44,7 @@ class ComposerAutoloaderInitf856c46a38122313790aa31708d122a3
     }
 }
 
-function composerRequiref856c46a38122313790aa31708d122a3($file)
+function composerRequire4c26a5bcff209efe42702c92c38cbf4d($file)
 {
     require $file;
 }
--- a/viewonline.php
+++ b/viewonline.php
@@ -85,6 +85,8 @@ if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
 	page_footer();
 }
 
+$user->update_session_infos();
+
 // Forum info
 $sql_ary = array(
 	'SELECT'	=> 'f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id',
