aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/build.xml6
-rwxr-xr-xgit-tools/hooks/commit-msg9
-rw-r--r--phpBB/adm/style/admin.css1
-rw-r--r--phpBB/assets/javascript/core.js1
-rwxr-xr-xphpBB/bin/phpbbcli.php5
-rw-r--r--phpBB/includes/acp/acp_logs.php2
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/functions.php12
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/language/en/acp/profile.php4
-rw-r--r--phpBB/language/en/email/newtopic_notify.txt4
-rw-r--r--phpBB/phpbb/avatar/driver/local.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php5
-rw-r--r--phpBB/phpbb/db/migrator.php2
-rw-r--r--phpBB/phpbb/di/container_builder.php7
-rw-r--r--phpBB/phpbb/event/php_exporter.php25
-rw-r--r--phpBB/phpbb/session.php8
-rw-r--r--phpBB/phpbb/template/context.php10
-rw-r--r--phpBB/phpbb/template/twig/extension.php2
-rw-r--r--phpBB/styles/prosilver/template/mcp_ban.html6
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html12
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html8
-rw-r--r--phpBB/styles/prosilver/template/plupload.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html5
-rw-r--r--phpBB/styles/prosilver/template/posting_smilies.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html4
-rw-r--r--phpBB/styles/prosilver/template/simple_footer.html6
-rw-r--r--phpBB/styles/prosilver/template/ucp_agreement.html5
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_personal.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_register.html4
-rw-r--r--phpBB/styles/prosilver/theme/common.css4
-rw-r--r--phpBB/styles/prosilver/theme/responsive.css1
-rw-r--r--phpBB/viewforum.php2
-rw-r--r--tests/event/fixtures/extra_description.test2
-rw-r--r--tests/event/php_exporter_test.php2
-rw-r--r--tests/migrator/get_callable_from_step_test.php136
-rw-r--r--tests/random/gen_rand_string_test.php10
-rw-r--r--tests/template/context_test.php96
40 files changed, 358 insertions, 74 deletions
diff --git a/build/build.xml b/build/build.xml
index 9da74c9ba0..b4fab62c29 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.2.3" />
- <property name="prevversion" value="3.2.2" />
- <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.3-RC1, 3.2.3-RC2" />
+ <property name="newversion" value="3.2.4-dev" />
+ <property name="prevversion" value="3.2.3" />
+ <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.2" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg
index 136606252c..b73005b34d 100755
--- a/git-tools/hooks/commit-msg
+++ b/git-tools/hooks/commit-msg
@@ -147,6 +147,15 @@ then
quit $ERR_LENGTH;
fi
+# Check for CR/LF line breaks
+if grep -q $'\r$' "$1"
+then
+ complain "The commit message uses CR/LF line breaks, which are not permitted." >&2
+ complain >&2
+
+ quit $ERR_EOF;
+fi
+
lines=$(wc -l "$1" | awk '{ print $1; }');
expecting=header;
in_description=0;
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index efdd6f1e22..7cf6c22236 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -840,6 +840,7 @@ table.zebra-table tbody tr:nth-child(odd) {
}
.row2 {
+ word-break: break-all;
background-color: #DCEBFE;
}
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index bd1925baf6..752dfa4ab2 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1332,7 +1332,6 @@ phpbb.toggleDropdown = function() {
marginLeft: 0,
left: 0,
marginRight: 0,
- right: 0,
maxWidth: (windowWidth - 4) + 'px'
});
diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php
index 3061fee817..5ae18334d9 100755
--- a/phpBB/bin/phpbbcli.php
+++ b/phpBB/bin/phpbbcli.php
@@ -71,9 +71,12 @@ require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
register_compatibility_globals();
+/** @var \phpbb\config\config $config */
+$config = $phpbb_container->get('config');
+
/** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');
-$language->set_default_language($phpbb_container->get('config')['default_lang']);
+$language->set_default_language($config['default_lang']);
$language->add_lang(array('common', 'acp/common', 'cli'));
/* @var $user \phpbb\user */
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 8c3fb66a70..f9bb35791c 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -151,7 +151,7 @@ class acp_logs
{
$data = array();
- $checks = array('viewtopic', 'viewlogs', 'viewforum');
+ $checks = array('viewpost', 'viewtopic', 'viewlogs', 'viewforum');
foreach ($checks as $check)
{
if (isset($row[$check]) && $row[$check])
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 27574698c0..29ca6959c8 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-@define('PHPBB_VERSION', '3.2.3');
+@define('PHPBB_VERSION', '3.2.4-dev');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 24642faade..cbea7afe6e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -66,23 +66,29 @@ function set_var(&$result, $var, $type, $multibyte = false)
/**
* Generates an alphanumeric random string of given length
*
+* @param int $num_chars Length of random string, defaults to 8.
+* This number should be less or equal than 64.
+*
* @return string
*/
function gen_rand_string($num_chars = 8)
{
// [a, z] + [0, 9] = 36
- return substr(strtoupper(base_convert(unique_id(), 16, 36)), 0, $num_chars);
+ return substr(strtoupper(base_convert(bin2hex(random_bytes($num_chars + 1)), 16, 36)), 0, $num_chars);
}
/**
* Generates a user-friendly alphanumeric random string of given length
* We remove 0 and O so users cannot confuse those in passwords etc.
*
+* @param int $num_chars Length of random string, defaults to 8.
+* This number should be less or equal than 64.
+*
* @return string
*/
function gen_rand_string_friendly($num_chars = 8)
{
- $rand_str = unique_id();
+ $rand_str = bin2hex(random_bytes($num_chars + 1));
// Remove Z and Y from the base_convert(), replace 0 with Z and O with Y
// [a, z] + [0, 9] - {z, y} = [a, z] + [0, 9] - {0, o} = 34
@@ -4424,7 +4430,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
'U_CONTACT_US' => ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
- 'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
+ 'U_TEAM' => (!$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
'UA_PRIVACY' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy')),
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index beb440ce76..a36bf619f8 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -159,7 +159,7 @@ class ucp_profile
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_EMAIL', false, array(
'reportee_id' => $user->data['user_id'],
$user->data['username'],
- $data['user_email'],
+ $user->data['user_email'],
$data['email']
));
}
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index ed811fab81..21f26b5f08 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -280,7 +280,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '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');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.3');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.4-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php
index d365aeb183..41cbd9cb93 100644
--- a/phpBB/language/en/acp/profile.php
+++ b/phpBB/language/en/acp/profile.php
@@ -161,8 +161,8 @@ $lang = array_merge($lang, array(
'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options.<br /><strong>Please note that changes to profile fields will not affect existing profile fields entered by your users.</strong>',
'STEP_2_TITLE_CREATE' => 'Profile type specific options',
'STEP_2_TITLE_EDIT' => 'Profile type specific options',
- 'STEP_3_EXPLAIN_CREATE' => 'Since you have more than one board language installed, you have to fill out the remaining language items too. The profile field will work with the default language enabled, you are able to fill out the remaining language items later too.',
- 'STEP_3_EXPLAIN_EDIT' => 'Since you have more than one board language installed, you now can change or add the remaining language items too. The profile field will work with the default language enabled.',
+ 'STEP_3_EXPLAIN_CREATE' => 'Since you have more than one board language installed, you have to fill out the remaining language items too. If you don’t, then default language setting for this custom profile field will be used, you are able to fill out the remaining language items later too.',
+ 'STEP_3_EXPLAIN_EDIT' => 'Since you have more than one board language installed, you now can change or add the remaining language items too. If you don’t, then default language setting for this custom profile field will be used.',
'STEP_3_TITLE_CREATE' => 'Remaining language definitions',
'STEP_3_TITLE_EDIT' => 'Language definitions',
'STRING_DEFAULT_VALUE_EXPLAIN' => 'Enter a default phrase to be displayed, a default value. Leave empty if you want to show it empty at the first place.',
diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt
index b9416d8e40..12e0bb8393 100644
--- a/phpBB/language/en/email/newtopic_notify.txt
+++ b/phpBB/language/en/email/newtopic_notify.txt
@@ -6,6 +6,10 @@ You are receiving this notification because you are watching the forum "{FORUM_N
{U_FORUM}
+To see new topic directly, visit the following link:
+
+{U_TOPIC}
+
If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link:
{U_STOP_WATCHING_FORUM}
diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php
index 8b773017c5..4b84e4201c 100644
--- a/phpBB/phpbb/avatar/driver/local.php
+++ b/phpBB/phpbb/avatar/driver/local.php
@@ -158,7 +158,7 @@ class local extends \phpbb\avatar\driver\driver
*/
protected function get_avatar_list($user)
{
- $avatar_list = ($this->cache == null) ? false : $this->cache->get('_avatar_local_list');
+ $avatar_list = ($this->cache == null) ? false : $this->cache->get('_avatar_local_list_' . $user->data['user_lang']);
if ($avatar_list === false)
{
@@ -198,7 +198,7 @@ class local extends \phpbb\avatar\driver\driver
if ($this->cache != null)
{
- $this->cache->put('_avatar_local_list', $avatar_list, 86400);
+ $this->cache->put('_avatar_local_list_' . $user->data['user_lang'], $avatar_list, 86400);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php
index a52067f484..804adc4490 100644
--- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php
+++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php
@@ -32,10 +32,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration
return array(
array('config.add', array('help_send_statistics', true)),
array('config.add', array('help_send_statistics_time', 0)),
- array('if', array(
- array('module.exists', array('acp', false, 'ACP_SEND_STATISTICS')),
- array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')),
- )),
+ array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')),
array('module.add', array(
'acp',
'ACP_SERVER_CONFIGURATION',
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index a425df56e8..2b0c66fc58 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -760,7 +760,7 @@ class migrator
$condition = $parameters[0];
- if (!$condition)
+ if (!$condition || (is_array($condition) && !$this->run_step($condition, $last_result, $reverse)))
{
return false;
}
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
index ac1a1a1733..8c1ce8bde2 100644
--- a/phpBB/phpbb/di/container_builder.php
+++ b/phpBB/phpbb/di/container_builder.php
@@ -143,6 +143,13 @@ class container_builder
{
if ($this->use_extensions)
{
+ $autoload_cache = new ConfigCache($this->get_autoload_filename(), defined('DEBUG'));
+ if (!$autoload_cache->isFresh())
+ {
+ // autoload cache should be refreshed
+ $this->load_extensions();
+ }
+
require($this->get_autoload_filename());
}
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
index 64d1e429b7..71c94a681d 100644
--- a/phpBB/phpbb/event/php_exporter.php
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -264,7 +264,30 @@ class php_exporter
// Find event description line
$description_line_num = $this->find_description();
- $description = substr(trim($this->file_lines[$description_line_num]), strlen('* '));
+ $description_lines = array();
+
+ while (true)
+ {
+ $description_line = substr(trim($this->file_lines[$description_line_num]), strlen('*'));
+ $description_line = trim(str_replace("\t", " ", $description_line));
+
+ // Reached end of description if line is a tag
+ if (strlen($description_line) && $description_line[0] == '@')
+ {
+ break;
+ }
+
+ $description_lines[] = $description_line;
+ $description_line_num++;
+ }
+
+ // If there is an empty line between description and first tag, remove it
+ if (!strlen(end($description_lines)))
+ {
+ array_pop($description_lines);
+ }
+
+ $description = trim(implode('<br/>', $description_lines));
if (isset($this->events[$this->current_event]))
{
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index de9345ca85..80934dc411 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -1614,13 +1614,15 @@ class session
return;
}
+ // Do not update the session page for ajax requests, so the view online still works as intended
+ $page_changed = $this->update_session_page && $this->data['session_page'] != $this->page['page'] && !$request->is_ajax();
+
// Only update session DB a minute or so after last update or if page changes
- if ($this->time_now - ((isset($this->data['session_time'])) ? $this->data['session_time'] : 0) > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
+ if ($this->time_now - (isset($this->data['session_time']) ? $this->data['session_time'] : 0) > 60 || $page_changed)
{
$sql_ary = array('session_time' => $this->time_now);
- // Do not update the session page for ajax requests, so the view online still works as intended
- if ($this->update_session_page && !$request->is_ajax())
+ if ($page_changed)
{
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
$sql_ary['session_forum_id'] = $this->page['forum'];
diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php
index de583d3224..2ba6d185ad 100644
--- a/phpBB/phpbb/template/context.php
+++ b/phpBB/phpbb/template/context.php
@@ -274,6 +274,11 @@ class context
{
$name = substr($blocks[$i], 0, $pos);
+ if (empty($block[$name]))
+ {
+ return array();
+ }
+
if (strpos($blocks[$i], '[]') === $pos)
{
$index = count($block[$name]) - 1;
@@ -286,6 +291,11 @@ class context
else
{
$name = $blocks[$i];
+ if (empty($block[$name]))
+ {
+ return array();
+ }
+
$index = count($block[$name]) - 1;
}
$block = $block[$name];
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index 1aa7717470..f6f8e03ca2 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -172,7 +172,7 @@ class extension extends \Twig_Extension
$context_vars = $this->context->get_root_ref();
- if (isset($context_vars['L_' . $key]))
+ if (is_string($key) && isset($context_vars['L_' . $key]))
{
return $context_vars['L_' . $key];
}
diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html
index 5b798d9b6c..f6e4620ad8 100644
--- a/phpBB/styles/prosilver/template/mcp_ban.html
+++ b/phpBB/styles/prosilver/template/mcp_ban.html
@@ -1,8 +1,6 @@
<!-- INCLUDE mcp_header.html -->
-<script type="text/javascript">
-// <![CDATA[
-
+<script>
var ban_length = new Array();
ban_length[-1] = '';
var ban_reason = new Array();
@@ -34,8 +32,6 @@
document.getElementById('unbangivereason').innerHTML = '';
}
}
-
-// ]]>
</script>
<form id="mcp_ban" method="post" action="{U_ACTION}">
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
index b8080a6be3..2d33849cf0 100644
--- a/phpBB/styles/prosilver/template/navbar_header.html
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -123,11 +123,13 @@
<i class="icon fa-sliders fa-fw" aria-hidden="true"></i><span>{L_PROFILE}</span>
</a>
</li>
- <li>
- <a href="{U_USER_PROFILE}" title="{L_READ_PROFILE}" role="menuitem">
- <i class="icon fa-user fa-fw" aria-hidden="true"></i><span>{L_READ_PROFILE}</span>
- </a>
- </li>
+ <!-- IF U_USER_PROFILE -->
+ <li>
+ <a href="{U_USER_PROFILE}" title="{L_READ_PROFILE}" role="menuitem">
+ <i class="icon fa-user fa-fw" aria-hidden="true"></i><span>{L_READ_PROFILE}</span>
+ </a>
+ </li>
+ <!-- ENDIF -->
<!-- EVENT navbar_header_profile_list_after -->
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 083d974d13..bdff1a0c05 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -63,13 +63,13 @@
<!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
</div>
-<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- 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>
+<script src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script>window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
+<script src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
<!-- INCLUDEJS forum_fn.js -->
<!-- INCLUDEJS ajax.js -->
<!-- IF S_ALLOW_CDN -->
- <script type="text/javascript">
+ <script>
(function($){
var $fa_cdn = $('head').find('link[rel="stylesheet"]').first(),
$span = $('<span class="fa" style="display:none"></span>').appendTo('body');
diff --git a/phpBB/styles/prosilver/template/plupload.html b/phpBB/styles/prosilver/template/plupload.html
index fc663118c1..1eb84372e8 100644
--- a/phpBB/styles/prosilver/template/plupload.html
+++ b/phpBB/styles/prosilver/template/plupload.html
@@ -1,5 +1,4 @@
-<script type="text/javascript">
-//<![CDATA[
+<script>
phpbb.plupload = {
i18n: {
'b': '{LA_BYTES_SHORT}',
@@ -63,7 +62,6 @@ phpbb.plupload = {
maxFiles: {MAX_ATTACHMENTS},
data: {S_ATTACH_DATA},
}
-//]]>
</script>
<!-- INCLUDEJS {T_ASSETS_PATH}/plupload/plupload.full.min.js -->
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/plupload.js -->
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 14185ed66b..122afdf978 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -1,6 +1,5 @@
-<script type="text/javascript">
-// <![CDATA[
+<script>
var form_name = 'postform';
var text_name = <!-- IF $SIG_EDIT -->'signature'<!-- ELSE -->'message'<!-- ENDIF -->;
var load_draft = false;
@@ -46,8 +45,6 @@
document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
}
}
-
-// ]]>
</script>
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html
index 54e82a58bc..b5794d5aff 100644
--- a/phpBB/styles/prosilver/template/posting_smilies.html
+++ b/phpBB/styles/prosilver/template/posting_smilies.html
@@ -1,10 +1,8 @@
<!-- INCLUDE simple_header.html -->
-<script type="text/javascript">
-// <![CDATA[
+<script>
var form_name = opener.form_name;
var text_name = opener.text_name;
-// ]]>
</script>
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index 857c686774..55739070ae 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -5,10 +5,8 @@
</h3>
<div id="topicreview" class="topicreview">
-<script type="text/javascript">
-// <![CDATA[
+<script>
bbcodeEnabled = {S_BBCODE_ALLOWED};
-// ]]>
</script>
<!-- BEGIN topic_review_row -->
diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html
index 614c137835..907ddd97ba 100644
--- a/phpBB/styles/prosilver/template/simple_footer.html
+++ b/phpBB/styles/prosilver/template/simple_footer.html
@@ -24,9 +24,9 @@
</div>
</div>
-<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- 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>
+<script src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script>window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
+<script src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
<!-- INCLUDEJS forum_fn.js -->
<!-- INCLUDEJS ajax.js -->
diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html
index 943774c6ec..ace65254d7 100644
--- a/phpBB/styles/prosilver/template/ucp_agreement.html
+++ b/phpBB/styles/prosilver/template/ucp_agreement.html
@@ -3,8 +3,7 @@
<!-- IF S_SHOW_COPPA or S_REGISTRATION -->
<!-- IF S_LANG_OPTIONS -->
-<script type="text/javascript">
-// <![CDATA[
+<script>
/**
* Change language
*/
@@ -14,8 +13,6 @@
document.forms['register'].change_lang.value = lang_iso;
document.forms['register'].submit();
}
-
-// ]]>
</script>
<form method="post" action="{S_UCP_ACTION}" id="register">
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index e97befc552..6362a0b824 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -6,10 +6,8 @@
<!-- EVENT ucp_pm_history_review_before -->
<div id="topicreview" class="topicreview">
- <script type="text/javascript">
- // <![CDATA[
+ <script>
bbcodeEnabled = {S_BBCODE_ALLOWED};
- // ]]>
</script>
<!-- BEGIN history_row -->
<div class="post <!-- IF history_row.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
index 4cd9f6655b..1650705d4b 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
@@ -85,8 +85,7 @@
</fieldset>
</form>
-<script type="text/javascript">
-// <![CDATA[
+<script>
var date_format = '{A_DATE_FORMAT}';
var default_dateformat = '{A_DEFAULT_DATEFORMAT}';
@@ -118,7 +117,6 @@
}
window.onload = customDates;
-// ]]>
</script>
<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html
index 38413addba..bf39990c35 100644
--- a/phpBB/styles/prosilver/template/ucp_register.html
+++ b/phpBB/styles/prosilver/template/ucp_register.html
@@ -1,7 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<script type="text/javascript">
-// <![CDATA[
+<script>
/**
* Change language
*/
@@ -11,7 +10,6 @@
document.forms['register'].change_lang.value = lang_iso;
document.forms['register'].submit.click();
}
-// ]]>
</script>
<form id="register" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 6223b22173..a0dc5e043b 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -1274,6 +1274,10 @@ ul.linklist:after,
width: 50px;
}
+.dropdown .clone.hidden {
+ display: none;
+}
+
.dropdown .clone.hidden + li.separator {
display: none;
}
diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css
index fcc11f1fc2..ca4054c27f 100644
--- a/phpBB/styles/prosilver/theme/responsive.css
+++ b/phpBB/styles/prosilver/theme/responsive.css
@@ -421,6 +421,7 @@
.column1, .column2, .left-box.profile-details {
float: none;
width: auto;
+ clear: both;
}
/* Polls
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 04a39e83d5..416ffe3d90 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -506,7 +506,7 @@ if ($forum_data['forum_type'] == FORUM_POST)
'WHERE' => '(t.forum_id = ' . $forum_id . '
AND t.topic_type = ' . POST_ANNOUNCE . ') OR
- (' . $db->sql_in_set('t.forum_id', $g_forum_ary) . '
+ (' . $db->sql_in_set('t.forum_id', $g_forum_ary, false, true) . '
AND t.topic_type = ' . POST_GLOBAL . ')',
'ORDER_BY' => 't.topic_time DESC',
diff --git a/tests/event/fixtures/extra_description.test b/tests/event/fixtures/extra_description.test
index ce8f97ce89..e93a1044ac 100644
--- a/tests/event/fixtures/extra_description.test
+++ b/tests/event/fixtures/extra_description.test
@@ -3,7 +3,7 @@
/**
* Description
*
-* NOTE: This will not be exported
+* NOTE: This will also be exported
*
* @event extra_description.dispatch
* @since 3.1.0-b2
diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php
index 21dbb1e1d4..c6670e1340 100644
--- a/tests/event/php_exporter_test.php
+++ b/tests/event/php_exporter_test.php
@@ -57,7 +57,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
'file' => 'extra_description.test',
'arguments' => array(),
'since' => '3.1.0-b2',
- 'description' => 'Description',
+ 'description' => 'Description<br/><br/>NOTE: This will also be exported',
),
),
),
diff --git a/tests/migrator/get_callable_from_step_test.php b/tests/migrator/get_callable_from_step_test.php
new file mode 100644
index 0000000000..af636f5d21
--- /dev/null
+++ b/tests/migrator/get_callable_from_step_test.php
@@ -0,0 +1,136 @@
+<?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.
+ *
+ */
+
+class get_callable_from_step_test extends phpbb_database_test_case
+{
+ public function setUp()
+ {
+ global $phpbb_root_path, $php_ext, $table_prefix, $phpbb_log;
+
+ parent::setUp();
+
+ $phpbb_log = $this->getMockBuilder('\phpbb\log\log')->disableOriginalConstructor()->getMock();
+ $db = $this->new_dbal();
+ $factory = new \phpbb\db\tools\factory();
+ $cache_service = $this->getMockBuilder('\phpbb\cache\service')->disableOriginalConstructor()->getMock();
+ $user = $this->getMockBuilder('\phpbb\user')->disableOriginalConstructor()->getMock();
+ $module_manager = new \phpbb\module\module_manager(
+ $this->getMockBuilder('\phpbb\cache\driver\dummy')->disableOriginalConstructor()->getMock(),
+ $db,
+ new phpbb_mock_extension_manager($phpbb_root_path),
+ 'phpbb_modules',
+ $phpbb_root_path,
+ $php_ext
+ );
+ $module_tools = new \phpbb\db\migration\tool\module($db, $cache_service, $user, $module_manager, $phpbb_root_path, $php_ext, 'phpbb_modules');
+ $this->migrator = new \phpbb\db\migrator(
+ new phpbb_mock_container_builder(),
+ new \phpbb\config\config(array()),
+ $db,
+ $factory->get($db),
+ 'phpbb_migrations',
+ $phpbb_root_path,
+ $php_ext,
+ $table_prefix,
+ array($module_tools),
+ new \phpbb\db\migration\helper()
+ );
+
+ if (!$module_tools->exists('acp', 0, 'new_module_langname'))
+ {
+ $module_tools->add('acp', 0, array(
+ 'module_basename' => 'new_module_basename',
+ 'module_langname' => 'new_module_langname',
+ 'module_mode' => 'settings',
+ 'module_auth' => '',
+ 'module_display' => true,
+ 'before' => false,
+ 'after' => false,
+ ));
+ $this->module_added = true;
+ }
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/../dbal/fixtures/migrator.xml');
+ }
+
+ public function get_callable_from_step_provider()
+ {
+ return array(
+ array(
+ array('if', array(
+ false,
+ array('permission.add', array('some_data')),
+ )),
+ true, // expects false
+ ),
+ array(
+ array('if', array(
+ array('module.exists', array(
+ 'mcp',
+ 'RANDOM_PARENT',
+ 'RANDOM_MODULE'
+ )),
+ array('permission.add', array('some_data')),
+ )),
+ true, // expects false
+ ),
+ array(
+ array('if', array(
+ array('module.exists', array(
+ 'acp',
+ 0,
+ 'new_module_langname'
+ )),
+ array('module.add', array(
+ 'acp',
+ 0,
+ 'module_basename' => 'new_module_basename2',
+ 'module_langname' => 'new_module_langname2',
+ 'module_mode' => 'settings',
+ 'module_auth' => '',
+ 'module_display' => true,
+ 'before' => false,
+ 'after' => false,
+ )),
+ )),
+ false, // expects false
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_callable_from_step_provider
+ */
+ public function test_get_callable_from_step($step, $expects_false)
+ {
+ if ($expects_false)
+ {
+ $this->assertFalse($this->call_get_callable_from_step($step));
+ }
+ else
+ {
+ $this->assertNotFalse($this->call_get_callable_from_step($step));
+ }
+ }
+
+ protected function call_get_callable_from_step($step)
+ {
+ $class = new ReflectionClass($this->migrator);
+ $method = $class->getMethod('get_callable_from_step');
+ $method->setAccessible(true);
+ return $method->invokeArgs($this->migrator, array($step));
+ }
+}
diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php
index a9d1ea20de..428db6ac98 100644
--- a/tests/random/gen_rand_string_test.php
+++ b/tests/random/gen_rand_string_test.php
@@ -40,7 +40,10 @@ class phpbb_random_gen_rand_string_test extends phpbb_test_case
$random_string_length = strlen($random_string);
$this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH);
- $this->assertTrue($random_string_length <= $num_chars);
+ $this->assertTrue(
+ $random_string_length == $num_chars,
+ sprintf('Failed asserting that random string length matches expected length. Expected %1$u, Actual %2$u', $num_chars, $random_string_length)
+ );
$this->assertRegExp('#^[A-Z0-9]+$#', $random_string);
}
}
@@ -56,7 +59,10 @@ class phpbb_random_gen_rand_string_test extends phpbb_test_case
$random_string_length = strlen($random_string);
$this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH);
- $this->assertTrue($random_string_length <= $num_chars);
+ $this->assertTrue(
+ $random_string_length == $num_chars,
+ sprintf('Failed asserting that random string length matches expected length. Expected %1$u, Actual %2$u', $num_chars, $random_string_length)
+ );
$this->assertRegExp('#^[A-NP-Z1-9]+$#', $random_string);
}
}
diff --git a/tests/template/context_test.php b/tests/template/context_test.php
new file mode 100644
index 0000000000..52ce6c8fde
--- /dev/null
+++ b/tests/template/context_test.php
@@ -0,0 +1,96 @@
+<?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.
+*
+*/
+
+class context_test extends phpbb_test_case
+{
+ protected $context;
+ protected function setUp()
+ {
+ $this->context = new \phpbb\template\context();
+
+ for ($i = 0; $i < 10; $i++)
+ {
+ $this->context->assign_block_vars('block' . $i, array(
+ 'FOO' . $i => 'foo' . $i,
+ 'BAR' . $i => 'bar' . $i,
+ ));
+
+ for ($j = 0; $j < 10; $j++)
+ {
+ $this->context->assign_block_vars('block' . $i . '.subblock', array(
+ 'SUBFOO' => 'subfoo' . $j,
+ 'SUBBAR' => 'subbar' . $j,
+ ));
+
+ for ($k = 0; $k < 10; $k++)
+ {
+ $this->context->assign_block_vars('block' . $i . '.subblock.subsubblock', array(
+ 'SUBSUBFOO' => 'subsubfoo' . $k,
+ 'SUBSUBBAR' => 'subsubbar' . $k,
+ ));
+ }
+ }
+ }
+ }
+
+ public function retrieve_block_vars_data()
+ {
+ return array(
+ array('foo', array(), array()), // non-existent top-level block
+ array('block1.foo', array(), array()), // non-existent sub-level block
+ array('block1', array(), array( // top-level block, all vars
+ 'FOO1' => 'foo1',
+ 'BAR1' => 'bar1',
+ )),
+ array('block1', array('FOO1'), array( // top-level block, one var
+ 'FOO1' => 'foo1',
+ )),
+ array('block2.subblock', array(), array( // sub-level block, all vars
+ 'SUBFOO' => 'subfoo9',
+ 'SUBBAR' => 'subbar9',
+ )),
+ array('block2.subblock', array('SUBBAR'), array( // sub-level block, one var
+ 'SUBBAR' => 'subbar9',
+ )),
+ array('block2.subblock.subsubblock', array(), array( // sub-sub-level block, all vars
+ 'SUBSUBFOO' => 'subsubfoo9',
+ 'SUBSUBBAR' => 'subsubbar9',
+ )),
+ array('block2.subblock.subsubblock', array('SUBSUBBAR'), array( // sub-sub-level block, one var
+ 'SUBSUBBAR' => 'subsubbar9',
+ )),
+ array('block3.subblock[2]', array(), array( // sub-level, exact index, all vars
+ 'SUBFOO' => 'subfoo2',
+ 'SUBBAR' => 'subbar2',
+ )),
+ array('block3.subblock[2]', array('SUBBAR'), array( // sub-level, exact index, one var
+ 'SUBBAR' => 'subbar2',
+ )),
+ array('block3.subblock[3].subsubblock[5]', array(), array( // sub-sub-level, exact index, all vars
+ 'SUBSUBFOO' => 'subsubfoo5',
+ 'SUBSUBBAR' => 'subsubbar5',
+ )),
+ array('block3.subblock[4].subsubblock[6]', array('SUBSUBFOO'), array( // sub-sub-level, exact index, one var
+ 'SUBSUBFOO' => 'subsubfoo6',
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider retrieve_block_vars_data
+ */
+ public function test_retrieve_block_vars($blockname, $vararray, $result)
+ {
+ $this->assertEquals($result, $this->context->retrieve_block_vars($blockname, $vararray));
+ }
+}