aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/code_sniffer/ruleset-php-legacy.xml12
-rw-r--r--build/code_sniffer/ruleset-php-strict.xml12
-rw-r--r--phpBB/assets/javascript/core.js3
-rw-r--r--phpBB/feed.php2
-rw-r--r--phpBB/includes/acp/acp_attachments.php7
-rw-r--r--phpBB/includes/acp/acp_ban.php2
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php5
-rw-r--r--phpBB/includes/acp/acp_bots.php27
-rw-r--r--phpBB/includes/acp/acp_captcha.php1
-rw-r--r--phpBB/includes/acp/acp_database.php2
-rw-r--r--phpBB/includes/acp/acp_extensions.php6
-rw-r--r--phpBB/includes/acp/acp_groups.php4
-rw-r--r--phpBB/includes/acp/acp_icons.php3
-rw-r--r--phpBB/includes/acp/acp_logs.php4
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php2
-rw-r--r--phpBB/includes/acp/acp_permissions.php1
-rw-r--r--phpBB/includes/acp/acp_php_info.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php2
-rw-r--r--phpBB/includes/acp/acp_prune.php14
-rw-r--r--phpBB/includes/acp/acp_ranks.php1
-rw-r--r--phpBB/includes/acp/acp_users.php4
-rw-r--r--phpBB/includes/acp/acp_words.php3
-rw-r--r--phpBB/includes/acp/auth.php1
-rw-r--r--phpBB/includes/captcha/captcha_gd.php21
-rw-r--r--phpBB/includes/functions.php19
-rw-r--r--phpBB/includes/functions_admin.php38
-rw-r--r--phpBB/includes/functions_compatibility.php46
-rw-r--r--phpBB/includes/functions_content.php6
-rw-r--r--phpBB/includes/functions_display.php1
-rw-r--r--phpBB/includes/functions_posting.php1
-rw-r--r--phpBB/includes/functions_privmsgs.php5
-rw-r--r--phpBB/includes/functions_upload.php2
-rw-r--r--phpBB/includes/functions_user.php14
-rw-r--r--phpBB/includes/mcp/info/mcp_pm_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_ban.php2
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php4
-rw-r--r--phpBB/includes/mcp/mcp_queue.php5
-rw-r--r--phpBB/includes/mcp/mcp_reports.php6
-rw-r--r--phpBB/includes/message_parser.php2
-rw-r--r--phpBB/includes/ucp/ucp_main.php2
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm.php1
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php3
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php22
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php2
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php6
-rw-r--r--phpBB/includes/utf/utf_normalizer.php6
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php2
-rw-r--r--phpBB/install/install_install.php45
-rw-r--r--phpBB/language/en/acp/common.php6
-rw-r--r--phpBB/language/en/acp/extensions.php1
-rw-r--r--phpBB/language/en/acp/permissions.php1
-rw-r--r--phpBB/language/en/acp/posting.php6
-rw-r--r--phpBB/language/en/common.php2
-rw-r--r--phpBB/language/en/email/admin_activate.txt3
-rw-r--r--phpBB/language/en/email/admin_send_email.txt1
-rw-r--r--phpBB/language/en/email/admin_welcome_activated.txt2
-rw-r--r--phpBB/language/en/email/admin_welcome_inactive.txt2
-rw-r--r--phpBB/language/en/email/email_notify.txt2
-rw-r--r--phpBB/language/en/email/installed.txt2
-rw-r--r--phpBB/language/en/email/pm_report_closed.txt3
-rw-r--r--phpBB/language/en/email/pm_report_deleted.txt3
-rw-r--r--phpBB/language/en/email/post_approved.txt2
-rw-r--r--phpBB/language/en/email/short/post_approved.txt2
-rw-r--r--phpBB/language/en/email/user_activate.txt2
-rw-r--r--phpBB/language/en/email/user_activate_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_activate_passwd.txt2
-rw-r--r--phpBB/language/en/email/user_reactivate_account.txt2
-rw-r--r--phpBB/language/en/email/user_remind_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_resend_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_welcome.txt2
-rw-r--r--phpBB/language/en/email/user_welcome_inactive.txt2
-rw-r--r--phpBB/language/en/groups.php2
-rw-r--r--phpBB/language/en/help_bbcode.php2
-rw-r--r--phpBB/language/en/help_faq.php2
-rw-r--r--phpBB/language/en/mcp.php2
-rw-r--r--phpBB/language/en/posting.php2
-rw-r--r--phpBB/language/en/ucp.php8
-rw-r--r--phpBB/language/en/viewtopic.php2
-rw-r--r--phpBB/phpbb/db/tools.php302
-rw-r--r--phpBB/phpbb/log/log.php2
-rw-r--r--phpBB/report.php2
-rw-r--r--phpBB/styles/prosilver/template/ajax.js2
-rw-r--r--phpBB/styles/prosilver/template/faq_body.html4
-rw-r--r--phpBB/styles/prosilver/template/mcp_footer.html3
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html9
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_pm_header.html3
-rw-r--r--phpBB/styles/prosilver/template/ucp_footer.html3
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_message_header.html12
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_topic_tools.html4
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css6
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css21
-rw-r--r--phpBB/styles/prosilver/theme/colours.css10
-rwxr-xr-x[-rw-r--r--]phpBB/styles/prosilver/theme/images/icon_print.gifbin424 -> 204 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_sendemail.gifbin531 -> 303 bytes
-rw-r--r--phpBB/viewtopic.php2
-rw-r--r--tests/dbal/db_tools_test.php54
-rw-r--r--tests/functions/validate_with_method_test.php39
-rw-r--r--tests/log/fixtures/full_log.xml12
-rw-r--r--tests/log/function_view_log_test.php27
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html2
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html3
-rw-r--r--tests/template/template_events_test.php21
-rw-r--r--tests/template/template_test.php19
-rw-r--r--tests/template/templates/loop_nested_include.html4
-rw-r--r--tests/template/templates/loop_nested_include1.html5
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php17
108 files changed, 679 insertions, 372 deletions
diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml
index 550c919b5d..65eb0a8622 100644
--- a/build/code_sniffer/ruleset-php-legacy.xml
+++ b/build/code_sniffer/ruleset-php-legacy.xml
@@ -41,6 +41,18 @@
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
+ <!-- There MUST NOT be trailing whitespace at the end of lines. -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
+
+ <!-- There MUST NOT be whitespace before the first content of a file -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
+
+ <!-- There MUST NOT be whitespace after the last content of a file -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
+
+ <!-- Functions MUST NOT contain multiple empty lines in a row -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
+
<!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
<rule ref="Zend.Files.ClosingTag" />
diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml
index 5e3c26a616..f2d5b86dd1 100644
--- a/build/code_sniffer/ruleset-php-strict.xml
+++ b/build/code_sniffer/ruleset-php-strict.xml
@@ -22,18 +22,6 @@
<!-- PHP keywords MUST be in lower case. -->
<rule ref="Generic.PHP.LowerCaseKeyword" />
- <!-- There MUST NOT be trailing whitespace at the end of lines. -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
-
- <!-- There MUST NOT be whitespace before the first content of a file -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
-
- <!-- There MUST NOT be whitespace after the last content of a file -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
-
- <!-- Functions MUST NOT contain multiple empty lines in a row -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
-
<!-- Classes etc. MUST be namespaced -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" />
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index ac866f7c78..4920a1167f 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -26,6 +26,7 @@ phpbb.loadingIndicator = function() {
if (!loadingIndicator.is(':visible')) {
loadingIndicator.fadeIn(phpbb.alertTime);
// Wait fifteen seconds and display an error if nothing has been returned by then.
+ phpbb.clearLoadingTimeout();
phpbbAlertTimer = setTimeout(function() {
if (loadingIndicator.is(':visible')) {
phpbb.alert($('#phpbb_alert').attr('data-l-err'), $('#phpbb_alert').attr('data-l-timeout-processing-req'));
@@ -315,7 +316,7 @@ phpbb.ajaxify = function(options) {
refresh = false;
}
- setTimeout(function() {
+ phpbbAlertTimer = setTimeout(function() {
if (refresh) {
window.location = res.REFRESH_DATA.url;
}
diff --git a/phpBB/feed.php b/phpBB/feed.php
index c31a6b6b1d..9ff8c66b9d 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -37,7 +37,7 @@ if (!empty($config['feed_http_auth']) && request_var('auth', '') == 'http')
}
$auth->acl($user->data);
-$user->setup();
+$user->setup('viewtopic');
// Initial var setup
$forum_id = request_var('f', 0);
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index d8d382b2bd..1aaf1f9c09 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -147,7 +147,6 @@ class acp_attachments
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'check_attachment_content' => array('lang' => 'CHECK_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
-
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -1287,7 +1286,7 @@ class acp_attachments
/**
* Set config attachment stat values
*
- * @param $stats array Array of config key => value pairs to set.
+ * @param $stats array Array of config key => value pairs to set.
* @return null
*/
public function set_attachment_stats($stats)
@@ -1301,7 +1300,7 @@ class acp_attachments
/**
* Check accuracy of attachment statistics.
*
- * @param $resync bool Resync stats if they're incorrect.
+ * @param $resync bool Resync stats if they're incorrect.
* @return bool|string Returns false if stats are correct or error message
* otherwise.
*/
@@ -1312,7 +1311,7 @@ class acp_attachments
// Get current files stats
$num_files = (int) $this->config['num_files'];
- $total_size = (float) $this->config['upload_dir_size'];
+ $total_size = (float) $this->config['upload_dir_size'];
if (($num_files != $stats['num_files']) || ($total_size != $stats['upload_dir_size']))
{
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 3ed9c225f5..41095f1382 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -109,7 +109,7 @@ class acp_ban
'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
-
+
'U_ACTION' => $this->u_action,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_ban&amp;field=ban'),
));
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 84382b6276..a3686f62fe 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -142,7 +142,7 @@ class acp_bbcodes
case 'create':
$sql_ary = $hidden_fields = array();
-
+
/**
* Modify custom bbcode data before the modify/create action
*
@@ -210,7 +210,6 @@ class acp_bbcodes
trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
if (strlen($bbcode_helpline) > 255)
{
trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -311,7 +310,7 @@ class acp_bbcodes
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
-
+
if ($request->is_ajax())
{
$json_response = new \phpbb\json_response;
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index e28a8d6451..7384f719bf 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -157,7 +157,7 @@ class acp_bots
{
$error[] = $user->lang['ERR_BOT_NO_MATCHES'];
}
-
+
if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip']))
{
if (!$ip_list = gethostbynamel($bot_row['bot_ip']))
@@ -176,7 +176,7 @@ class acp_bots
{
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
}
-
+
$bot_name = false;
if ($bot_id)
{
@@ -201,7 +201,7 @@ class acp_bots
{
$error[] = $user->lang['BOT_NAME_TAKEN'];
}
-
+
if (!sizeof($error))
{
// New bot? Create a new user and group entry
@@ -219,7 +219,6 @@ class acp_bots
{
trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
-
$user_id = user_add(array(
'user_type' => (int) USER_IGNORE,
@@ -233,7 +232,7 @@ class acp_bots
'user_style' => (int) $bot_row['bot_style'],
'user_allow_massemail' => 0,
));
-
+
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) $user_id,
'bot_name' => (string) $bot_row['bot_name'],
@@ -242,7 +241,7 @@ class acp_bots
'bot_ip' => (string) $bot_row['bot_ip'])
);
$db->sql_query($sql);
-
+
$log = 'ADDED';
}
else if ($bot_id)
@@ -289,12 +288,12 @@ class acp_bots
$log = 'UPDATED';
}
-
+
$cache->destroy('_bots');
-
+
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action));
-
+
}
}
else if ($bot_id)
@@ -335,11 +334,11 @@ class acp_bots
'U_ACTION' => $this->u_action . "&amp;id=$bot_id&amp;action=$action",
'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
-
+
'BOT_NAME' => $bot_row['bot_name'],
'BOT_IP' => $bot_row['bot_ip'],
'BOT_AGENT' => $bot_row['bot_agent'],
-
+
'S_EDIT_BOT' => true,
'S_ACTIVE_OPTIONS' => $s_active_options,
'S_STYLE_OPTIONS' => $style_select,
@@ -352,7 +351,7 @@ class acp_bots
break;
}
-
+
if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate'))
{
$json_response = new \phpbb\json_response;
@@ -397,7 +396,7 @@ class acp_bots
}
$db->sql_freeresult($result);
}
-
+
/**
* Validate bot name against username table
*/
@@ -417,7 +416,7 @@ class acp_bots
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
return ($row) ? false : true;
}
}
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 1a083c20ac..71defda09f 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -36,7 +36,6 @@ class acp_captcha
$selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin'];
$configure = request_var('configure', false);
-
// Oh, they are just here for the view
if (isset($_GET['captcha_demo']))
{
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 8afc3709b9..d28ee5b067 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -1180,7 +1180,6 @@ class postgres_extractor extends base_extractor
}
$db->sql_freeresult($result);
-
// Get the listing of primary keys.
$sql_pri_keys = "SELECT ic.relname as index_name, bc.relname as tab_name, ta.attname as column_name, i.indisunique as unique_key, i.indisprimary as primary_key
FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia
@@ -1280,7 +1279,6 @@ class postgres_extractor extends base_extractor
$ary_type[] = pg_field_type($result, $i);
$ary_name[] = pg_field_name($result, $i);
-
$sql = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
FROM pg_attrdef d, pg_class c
WHERE (c.relname = '{$table_name}')
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index 1de6987624..21a1909ac1 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -242,7 +242,7 @@ class acp_extensions
public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$enabled_extension_meta_data = array();
-
+
foreach ($phpbb_extension_manager->all_enabled() as $name => $location)
{
$md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template);
@@ -284,7 +284,7 @@ class acp_extensions
public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$disabled_extension_meta_data = array();
-
+
foreach ($phpbb_extension_manager->all_disabled() as $name => $location)
{
$md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template);
@@ -329,7 +329,7 @@ class acp_extensions
$uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured());
$available_extension_meta_data = array();
-
+
foreach ($uninstalled as $name => $location)
{
$md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template);
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 7ecedcf51e..c52289aa72 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -53,7 +53,6 @@ class acp_groups
$start = request_var('start', 0);
$update = (isset($_POST['update'])) ? true : false;
-
// Clear some vars
$group_row = array();
@@ -140,7 +139,7 @@ class acp_groups
if (confirm_box(true))
{
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
- group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
+ group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
else
@@ -331,7 +330,6 @@ class acp_groups
}
}
-
// Did we submit?
if ($update)
{
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 20b1f56182..9c7acf506c 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -203,7 +203,6 @@ class acp_icons
unset($_images[$row[$fields . '_url']]);
}
-
if ($row[$fields . '_id'] == $icon_id)
{
$after = true;
@@ -781,7 +780,7 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
-
+
if ($request->is_ajax())
{
$json_response = new \phpbb\json_response;
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 10852e3a68..2c795bb77b 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -118,7 +118,7 @@ class acp_logs
if ($mode == 'mod')
{
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id);
-
+
$template->assign_vars(array(
'S_SHOW_FORUMS' => true,
'S_FORUM_BOX' => $forum_box)
@@ -149,7 +149,7 @@ class acp_logs
foreach ($log_data as $row)
{
$data = array();
-
+
$checks = array('viewtopic', 'viewlogs', 'viewforum');
foreach ($checks as $check)
{
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index aca45575d3..812e22a025 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -270,7 +270,7 @@ class acp_permission_roles
case 'edit':
if ($action == 'edit')
- {
+ {
$sql = 'SELECT *
FROM ' . ACL_ROLES_TABLE . '
WHERE role_id = ' . $role_id;
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index e7dc03db5c..1924e2075b 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -330,7 +330,6 @@ class acp_permissions
}
}
-
// Setting permissions screen
$s_hidden_fields = build_hidden_fields(array(
'user_id' => $user_id,
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 125b77529f..13d2fd770a 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -81,7 +81,7 @@ class acp_php_info
$template->assign_var('PHPINFO', $output);
}
-
+
function remove_spaces($matches)
{
return '<a name="' . str_replace(' ', '_', $matches[1]) . '">';
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 4d316d84e4..b42b852fba 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -485,7 +485,6 @@ class acp_profile
}
$db->sql_freeresult($result);
-
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
FROM ' . PROFILE_LANG_TABLE . '
WHERE lang_id <> ' . $this->edit_lang_id . "
@@ -1116,7 +1115,6 @@ class acp_profile
}
}
-
$db->sql_transaction('begin');
if ($action == 'create')
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index d0e5dfb5f4..cefb63ce87 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -79,7 +79,7 @@ class acp_prune
$prune_posted = request_var('prune_days', 0);
$prune_viewed = request_var('prune_vieweddays', 0);
$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;
-
+
$prune_flags = 0;
$prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
$prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
@@ -109,7 +109,7 @@ class acp_prune
$p_result['topics'] = 0;
$p_result['posts'] = 0;
$log_data = '';
-
+
do
{
if (!$auth->acl_get('f_list', $row['forum_id']))
@@ -129,7 +129,7 @@ class acp_prune
$p_result['topics'] += $return['topics'];
$p_result['posts'] += $return['posts'];
}
-
+
if ($prune_viewed)
{
$return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false);
@@ -145,11 +145,11 @@ class acp_prune
'NUM_TOPICS' => $p_result['topics'],
'NUM_POSTS' => $p_result['posts'])
);
-
+
$log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
}
while ($row = $db->sql_fetchrow($result));
-
+
// Sync all pruned forums at once
sync('forum', 'forum_id', $prune_ids, true, true);
add_log('admin', 'LOG_PRUNE', $log_data);
@@ -256,7 +256,7 @@ class acp_prune
if ($deleteposts)
{
user_delete('remove', $user_ids);
-
+
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
}
else
@@ -444,7 +444,7 @@ class acp_prune
if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
{
$where_sql .= ' AND user_lastvisit = 0';
- }
+ }
else if (sizeof($active) && $active_select != 'lt')
{
$where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 73e1de44d9..55028cc882 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -214,7 +214,6 @@ class acp_ranks
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
);
-
return;
break;
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index a720334ed2..2f97011c70 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -735,7 +735,6 @@ class acp_users
sync('forum', 'forum_id', $forum_id_ary, false, true);
}
-
add_log('admin', 'LOG_USER_MOVE_POSTS', $user_row['username'], $forum_info['forum_name']);
add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_info['forum_name']);
@@ -1329,7 +1328,6 @@ class acp_users
}
}
-
$template->assign_block_vars('warn', array(
'ID' => $row['warning_id'],
'USERNAME' => ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-',
@@ -1379,7 +1377,6 @@ class acp_users
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
-
if ($submit)
{
$error = validate_data($data, array(
@@ -2243,7 +2240,6 @@ class acp_users
$error = array();
}
-
$sql = 'SELECT ug.*, g.*
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
WHERE ug.user_id = $user_id
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index d8d14ba4ad..859b586302 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -101,7 +101,7 @@ class acp_words
'word' => $word,
'replacement' => $replacement
);
-
+
if ($word_id)
{
$db->sql_query('UPDATE ' . WORDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE word_id = ' . $word_id);
@@ -162,7 +162,6 @@ class acp_words
break;
}
-
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 5404efded3..c95dd1d153 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -139,7 +139,6 @@ class auth_admin extends \phpbb\auth\auth
$auth2 = &$auth;
}
-
$hold_ary[$userdata['user_id']] = array();
foreach ($forum_ids as $f_id)
{
diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php
index 3a82457c4a..e7c01c040a 100644
--- a/phpBB/includes/captcha/captcha_gd.php
+++ b/phpBB/includes/captcha/captcha_gd.php
@@ -32,7 +32,7 @@ class captcha
function execute($code, $seed)
{
global $config;
-
+
mt_srand($seed);
// Create image
@@ -160,13 +160,13 @@ class captcha
function wave($img)
{
global $config;
-
+
$period_x = mt_rand(12,18);
$period_y = mt_rand(7,14);
$amp_x = mt_rand(5,10);
- $amp_y = mt_rand(2,4);
+ $amp_y = mt_rand(2,4);
$socket = mt_rand(0,100);
-
+
$dampen_x = mt_rand($this->width/5, $this->width/2);
$dampen_y = mt_rand($this->height/5, $this->height/2);
$direction_x = (mt_rand (0, 1));
@@ -185,7 +185,7 @@ class captcha
}
return $img;
}
-
+
/**
* Noise line
*/
@@ -236,7 +236,7 @@ class captcha
}
function captcha_noise_bg_bitmaps()
- {
+ {
return array(
'width' => 15,
'height' => 5,
@@ -300,7 +300,7 @@ class captcha
function captcha_bitmaps()
{
global $config;
-
+
$chars = array(
'A' => array(
array(
@@ -1681,7 +1681,7 @@ class captcha
'J' => $chars['J'][mt_rand(0, min(sizeof($chars['J']), $config['captcha_gd_fonts']) -1)],
'K' => $chars['K'][mt_rand(0, min(sizeof($chars['K']), $config['captcha_gd_fonts']) -1)],
'L' => $chars['L'][mt_rand(0, min(sizeof($chars['L']), $config['captcha_gd_fonts']) -1)],
- 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)],
+ 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)],
'N' => $chars['N'][mt_rand(0, min(sizeof($chars['N']), $config['captcha_gd_fonts']) -1)],
'O' => $chars['O'][mt_rand(0, min(sizeof($chars['O']), $config['captcha_gd_fonts']) -1)],
'P' => $chars['P'][mt_rand(0, min(sizeof($chars['P']), $config['captcha_gd_fonts']) -1)],
@@ -2196,7 +2196,7 @@ class colour_manager
{
$mode = $this->mode;
}
-
+
if (!is_array($colour))
{
if (isset($this->named_rgb[$colour]))
@@ -2352,7 +2352,6 @@ class colour_manager
$colour3[0] += 180;
$colour4[0] += 210;
-
$results[] = $this->allocate($colour2, $mode);
$results[] = $this->allocate($colour3, $mode);
$results[] = $this->allocate($colour4, $mode);
@@ -2390,7 +2389,7 @@ class colour_manager
}
// This is a hard problem. I chicken out and try to maintain readability at the cost of less randomness.
-
+
while ($count > 0)
{
$colour[1] = ($colour[1] + mt_rand(40,60)) % 99;
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 0cb88cd8ee..32b48fc799 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1005,24 +1005,6 @@ function phpbb_get_timezone_identifiers($selected_timezone)
}
/**
-* Pick a timezone
-*
-* @param string $default A timezone to select
-* @param boolean $truncate Shall we truncate the options text
-*
-* @return string Returns the options for timezone selector only
-*
-* @deprecated
-*/
-function tz_select($default = '', $truncate = false)
-{
- global $user;
-
- $timezone_select = phpbb_timezone_select($user, $default, $truncate);
- return $timezone_select['tz_select'];
-}
-
-/**
* Options to pick a timezone and date/time
*
* @param \phpbb\user $user Object of the current user
@@ -2712,7 +2694,6 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
WHERE user_id = " . $user->data['user_id'];
$db->sql_query($sql);
-
if ($request->is_ajax())
{
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index d72f89b6ac..68d6f6603a 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -746,7 +746,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* Perform additional actions before post(s) deletion
*
* @event core.delete_posts_before
- * @var string where_type Variable containing posts deletion mode
+ * @var string where_type Variable containing posts deletion mode
* @var mixed where_ids Array or comma separated list of posts ids to delete
* @var bool auto_sync Flag indicating if topics/forums should be synchronized
* @var bool posted_sync Flag indicating if topics_posted table should be resynchronized
@@ -907,7 +907,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* @var array poster_ids Array with deleted posts' author ids
* @var array topic_ids Array with deleted posts' topic ids
* @var array forum_ids Array with deleted posts' forum ids
- * @var string where_type Variable containing posts deletion mode
+ * @var string where_type Variable containing posts deletion mode
* @var mixed where_ids Array or comma separated list of posts ids to delete
* @var array delete_notifications_types Array with notifications types to delete
* @since 3.1.0-a4
@@ -925,7 +925,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* @var array poster_ids Array with deleted posts' author ids
* @var array topic_ids Array with deleted posts' topic ids
* @var array forum_ids Array with deleted posts' forum ids
- * @var string where_type Variable containing posts deletion mode
+ * @var string where_type Variable containing posts deletion mode
* @var mixed where_ids Array or comma separated list of posts ids to delete
* @var array delete_notifications_types Array with notifications types to delete
* @since 3.1.0-a4
@@ -2581,20 +2581,6 @@ function phpbb_cache_moderators($db, $cache, $auth)
}
/**
-* Cache moderators. Called whenever permissions are changed
-* via admin_permissions. Changes of usernames and group names
-* must be carried through for the moderators table.
-*
-* @deprecated 3.1
-* @return null
-*/
-function cache_moderators()
-{
- global $db, $cache, $auth;
- return phpbb_cache_moderators($db, $cache, $auth);
-}
-
-/**
* View log
*
* @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
@@ -2744,20 +2730,6 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false)
}
/**
-* Removes moderators and administrators from foe lists.
-*
-* @deprecated 3.1
-* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
-* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
-* @return null
-*/
-function update_foes($group_id = false, $user_id = false)
-{
- global $db, $auth;
- return phpbb_update_foes($db, $auth, $group_id, $user_id);
-}
-
-/**
* Lists inactive users
*/
function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC')
@@ -2929,7 +2901,7 @@ function get_database_size()
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles';
@@ -2938,7 +2910,7 @@ function get_database_size()
// Azure stats are stored elsewhere
if (strpos($row['mssql_version'], 'SQL Azure') !== false)
{
- $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
+ $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
FROM sys.dm_db_partition_stats';
}
}
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index 164dd4cb99..c2db53f86c 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -116,3 +116,49 @@ function phpbb_clean_path($path)
return $phpbb_path_helper->clean_path($path);
}
+
+/**
+* Pick a timezone
+*
+* @param string $default A timezone to select
+* @param boolean $truncate Shall we truncate the options text
+*
+* @return string Returns the options for timezone selector only
+*
+* @deprecated
+*/
+function tz_select($default = '', $truncate = false)
+{
+ global $user;
+
+ $timezone_select = phpbb_timezone_select($user, $default, $truncate);
+ return $timezone_select['tz_select'];
+}
+
+/**
+* Cache moderators. Called whenever permissions are changed
+* via admin_permissions. Changes of usernames and group names
+* must be carried through for the moderators table.
+*
+* @deprecated 3.1
+* @return null
+*/
+function cache_moderators()
+{
+ global $db, $cache, $auth;
+ return phpbb_cache_moderators($db, $cache, $auth);
+}
+
+/**
+* Removes moderators and administrators from foe lists.
+*
+* @deprecated 3.1
+* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
+* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
+* @return null
+*/
+function update_foes($group_id = false, $user_id = false)
+{
+ global $db, $auth;
+ return phpbb_update_foes($db, $auth, $group_id, $user_id);
+}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index b1f69c5756..d9a9004368 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -451,7 +451,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars)));
if ($censor_text)
- {
+ {
$text = censor_text($text);
}
@@ -499,7 +499,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
* For parsing custom parsed text to be stored within the database.
* This function additionally returns the uid and bitfield that needs to be stored.
* Expects $text to be the value directly from request_var() and in it's non-parsed form
-*
+*
* @param string $text The text to be replaced with the parsed one
* @param string $uid The BBCode uid for this parse
* @param string $bitfield The BBCode bitfield for this parse
@@ -1392,7 +1392,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
{
$username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
}
-
+
/**
* Use this event to change the output of get_username_string()
*
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 2b11d00f1e..463ebb83c9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -900,7 +900,6 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
$folder_new .= '_locked';
}
-
$folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 51bbcb8bae..1b1aeb9fa8 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -173,7 +173,6 @@ function update_post_information($type, $ids, $return_update_sql = false)
$ids = array($ids);
}
-
$update_sql = $empty_forums = $not_empty_forums = array();
if ($type != 'topic')
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 9b44984dfa..8581c7a8d9 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -314,7 +314,6 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
break;
}
-
if (!$result)
{
return false;
@@ -2030,10 +2029,10 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$decoded_message = bbcode_nl2br($decoded_message);
}
-
+
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
$parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
-
+
$message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
$subject = censor_text($subject);
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 9d61e39c98..b4e165502b 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -475,7 +475,7 @@ class fileerror extends filespec
class fileupload
{
var $allowed_extensions = array();
- var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title');
+ var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title');
var $max_filesize = 0;
var $min_width = 0;
var $min_height = 0;
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 6682622d94..2aaecf1fef 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1326,9 +1326,18 @@ function validate_data($data, $val_ary)
{
$function = array_shift($validate);
array_unshift($validate, $data[$var]);
- $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
- if ($result = call_user_func_array($function_prefix . $function, $validate))
+ if (is_array($function))
+ {
+ $result = call_user_func_array(array($function[0], 'validate_' . $function[1]), $validate);
+ }
+ else
+ {
+ $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
+ $result = call_user_func_array($function_prefix . $function, $validate);
+ }
+
+ if ($result)
{
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
@@ -2077,7 +2086,6 @@ function get_avatar_filename($avatar_entry)
{
global $config;
-
if ($avatar_entry[0] === 'g')
{
$avatar_group = true;
diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php
index 07dc564b19..d530a917cb 100644
--- a/phpBB/includes/mcp/info/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/info/mcp_pm_reports.php
@@ -19,7 +19,7 @@ class mcp_pm_reports_info
'title' => 'MCP_PM_REPORTS',
'version' => '1.0.0',
'modes' => array(
- 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
+ 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
),
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index d3bc336293..925d0878fc 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -171,7 +171,7 @@ class mcp_ban
case 'user':
$pre_fill = (string) $db->sql_fetchfield('username');
break;
-
+
case 'ip':
$pre_fill = (string) $db->sql_fetchfield('user_ip');
break;
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 008984b1c3..b0a06dd6ce 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -170,7 +170,7 @@ class mcp_pm_reports
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $pm_info['author_id']),
'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $pm_info['author_id']) : '',
-
+
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'),
@@ -304,7 +304,7 @@ class mcp_pm_reports
$template->assign_vars(array(
'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'],
'L_TITLE' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN'] : $user->lang['MCP_PM_REPORTS_CLOSED'],
-
+
'S_PM' => true,
'S_MCP_ACTION' => $this->u_action,
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 8d998919e5..f0a38db033 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -298,7 +298,6 @@ class mcp_queue
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
-
'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . '&amp;start=' . $start . '">', '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '<a href="' . $topic_url . '">', '</a>'),
@@ -1060,7 +1059,7 @@ class mcp_queue
if ($is_disapproving)
{
$l_log_message = ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED';
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason);
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason, $log_data['post_username']);
}
else
{
@@ -1126,7 +1125,6 @@ class mcp_queue
$post_data['disapprove_reason'] .= ($reason) ? "\n\n" . $reason : '';
}
-
if ($disapprove_all_posts_in_topic && $topic_information[$topic_id]['topic_posts_unapproved'] == 1)
{
// If there is only 1 post when disapproving the topic,
@@ -1144,7 +1142,6 @@ class mcp_queue
unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);
-
if ($num_disapproved_topics)
{
$success_msg = ($num_disapproved_topics == 1) ? 'TOPIC' : 'TOPICS';
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 8026e071cd..6fc8013fa4 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -98,10 +98,10 @@ class mcp_reports
$post_id = $report['post_id'];
$report_id = $report['report_id'];
-
+
$parse_post_flags = $report['reported_post_enable_bbcode'] ? OPTION_FLAG_BBCODE : 0;
$parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0;
- $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
+ $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
$post_info = get_post_data(array($post_id), 'm_report', true);
@@ -144,7 +144,6 @@ class mcp_reports
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
-
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
@@ -578,7 +577,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
$db->sql_query($sql);
-
if (sizeof($close_report_posts))
{
if ($pm)
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index ad6743b3a3..17a350bab3 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -104,7 +104,7 @@ class bbcode_firstpass extends bbcode
function bbcode_init($allow_custom_bbcode = true)
{
global $phpbb_dispatcher;
-
+
static $rowset;
// This array holds all bbcode data. BBCodes will be processed in this
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index b4b14b11d7..11ba2fba4d 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -619,7 +619,6 @@ class ucp_main
break;
}
-
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)],
@@ -691,7 +690,6 @@ class ucp_main
AND t.topic_id = tw.topic_id
AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
-
'ORDER_BY' => 't.topic_last_post_time DESC'
);
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
index 7c487b9073..f3b72d12aa 100644
--- a/phpBB/includes/ucp/ucp_notifications.php
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -99,7 +99,7 @@ class ucp_notifications
meta_refresh(3, $this->u_action);
$message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
-
+
if ($request->is_ajax())
{
$json_response = new \phpbb\json_response();
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 7e13b5b9c6..74dc08d875 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -172,7 +172,6 @@ class ucp_pm
trigger_error('NO_AUTH_READ_HOLD_MESSAGE');
}
-
// First Handle Mark actions and moving messages
$submit_mark = (isset($_POST['submit_mark'])) ? true : false;
$move_pm = (isset($_POST['move_pm'])) ? true : false;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 3d95dc9a97..e5a1c1b915 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -586,7 +586,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
);
$s_hidden_fields .= build_address_field($address_list);
-
confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
}
}
@@ -748,7 +747,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url;
$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
-
$save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED'];
$message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>');
@@ -1006,7 +1004,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Build hidden address list
$s_hidden_address_field = build_address_field($address_list);
-
$bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1);
$smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1);
$urls_checked = (isset($enable_urls)) ? !$enable_urls : 0;
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 26ce6ed28f..71c96a25b6 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -65,7 +65,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
trigger_error($message);
}
}
-
+
// Add Folder
if (isset($_POST['addfolder']))
{
@@ -226,7 +226,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Move Messages
case 1:
$num_moved = move_pm($user->data['user_id'], $user->data['message_limit'], $msg_ids, $move_to, $remove_folder_id);
-
+
// Something went wrong, only partially moved?
if ($num_moved != $folder_row['pm_count'])
{
@@ -418,7 +418,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$result = $db->sql_query($sql);
$num_messages = (int) $db->sql_fetchfield('num_messages');
$db->sql_freeresult($result);
-
+
$folder[PRIVMSGS_INBOX] = array(
'folder_name' => $user->lang['PM_INBOX'],
'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), $num_messages),
@@ -691,7 +691,7 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions)
{
global $db, $template, $auth, $user;
-
+
$template->assign_vars(array(
'S_COND_DEFINED' => true,
'S_COND_SELECT' => (!$hardcoded && isset($global_rule_conditions[$rule_option])) ? true : false)
@@ -715,7 +715,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
case 'text':
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
-
+
$template->assign_vars(array(
'S_TEXT_CONDITION' => true,
'CURRENT_STRING' => $rule_string,
@@ -729,7 +729,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
case 'user':
$rule_user_id = request_var('rule_user_id', 0);
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
-
+
if ($rule_string && !$rule_user_id)
{
$sql = 'SELECT user_id
@@ -791,10 +791,10 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
$sql .= 'WHERE';
}
-
- $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
+
+ $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
ORDER BY g.group_type DESC, g.group_name ASC';
-
+
$result = $db->sql_query($sql);
$s_group_options = '';
@@ -807,7 +807,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
$s_class = ($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '';
$s_selected = ($row['group_id'] == $rule_group_id) ? ' selected="selected"' : '';
-
+
$s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -845,7 +845,7 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
WHERE user_id = ' . $user_id . '
ORDER BY rule_id ASC';
$result = $db->sql_query($sql);
-
+
$count = 0;
while ($row = $db->sql_fetchrow($result))
{
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 03064a31d3..9b08a66a35 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -274,7 +274,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
$template->assign_block_vars('dl_method', $method);
}
-
+
foreach ($attachments as $attachment)
{
$template->assign_block_vars('attachment', array(
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index 090f9bf34c..0e33072515 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -224,15 +224,15 @@ class ucp_zebra
}
}
}
-
+
if ($request->is_ajax())
{
$message = ($updated) ? $user->lang[$l_mode . '_UPDATED'] : implode('<br />', $error);
-
+
$json_response = new \phpbb\json_response;
$json_response->send(array(
'success' => $updated,
-
+
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $message,
'REFRESH_DATA' => array(
diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php
index a208552d53..f8c9c76d4f 100644
--- a/phpBB/includes/utf/utf_normalizer.php
+++ b/phpBB/includes/utf/utf_normalizer.php
@@ -479,7 +479,6 @@ class utf_normalizer
continue;
}
-
// STEP 1: Decompose current char
// We have found a character that is either:
@@ -527,7 +526,6 @@ class utf_normalizer
$utf_seq = array($utf_char);
}
-
// STEP 2: Capture the starter
// Check out the combining class of the first character of the UTF sequence
@@ -683,7 +681,6 @@ class utf_normalizer
}
}
-
// STEP 3: Capture following combining modifiers
while ($pos < $len)
@@ -752,7 +749,6 @@ class utf_normalizer
}
}
-
// STEP 4: Sort and combine
// Here we sort...
@@ -991,7 +987,6 @@ class utf_normalizer
$tmp_pos = $last_cc = $sort = $dump = 0;
$utf_sort = array();
-
// Main loop
do
{
@@ -1047,7 +1042,6 @@ class utf_normalizer
continue;
}
-
// STEP 1: Decide what to do with current char
// Now, in that order:
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 29e5f7ab09..f3b8c82131 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -71,7 +71,6 @@ function phpbb_insert_forums()
$prune_enabled = (int) $src_db->sql_fetchfield('config_value');
$src_db->sql_freeresult($result);
-
// Insert categories
$sql = 'SELECT cat_id, cat_title
FROM ' . $convert->src_table_prefix . 'categories
@@ -571,7 +570,6 @@ function phpbb_convert_authentication($mode)
// What we will do is handling all 2.0.x admins as founder to replicate what is common in 2.0.x.
// After conversion the main admin need to make sure he is removing permissions and the founder status if wanted.
-
// Grab user ids of users with user_level of ADMIN
$sql = "SELECT user_id
FROM {$convert->src_table_prefix}users
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index a0c9cf9c5c..191be59258 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -217,7 +217,6 @@ class install_install extends module
'S_LEGEND' => false,
));
-
// Check for getimagesize
if (@function_exists('getimagesize'))
{
@@ -535,7 +534,6 @@ class install_install extends module
$url = (!in_array(false, $passed)) ? $this->p_master->module_url . "?mode=$mode&amp;sub=database&amp;language=$language" : $this->p_master->module_url . "?mode=$mode&amp;sub=requirements&amp;language=$language ";
$submit = (!in_array(false, $passed)) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST'];
-
$template->assign_vars(array(
'L_SUBMIT' => $submit,
'S_HIDDEN' => $s_hidden_fields,
@@ -1649,6 +1647,45 @@ class install_install extends module
$_module->move_module_by($row, 'move_up', 5);
}
+ if ($module_class == 'mcp')
+ {
+ // Move pm report details module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_report_details'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 3);
+
+ // Move closed pm reports module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_reports_closed'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 3);
+
+ // Move open pm reports module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_reports'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 3);
+ }
+
if ($module_class == 'ucp')
{
// Move attachment module 4 down...
@@ -1669,13 +1706,13 @@ class install_install extends module
WHERE module_basename = 'ucp_notifications'
AND module_class = 'ucp'
AND module_mode = 'notification_options'";
- $result = $db->sql_query($sql);
+ $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_down', 4);
- // Move OAuth module 5 down...
+ // Move OAuth module 5 down...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_basename = 'ucp_auth_link'
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 6f16dfabd4..6f6a5f901f 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -85,7 +85,6 @@ $lang = array_merge($lang, array(
'ACP_EXTENSION_MANAGEMENT' => 'Extension management',
'ACP_EXTENSIONS' => 'Manage extensions',
-
'ACP_FORUM_BASED_PERMISSIONS' => 'Forum based permissions',
'ACP_FORUM_LOGS' => 'Forum logs',
'ACP_FORUM_MANAGEMENT' => 'Forum management',
@@ -551,7 +550,7 @@ $lang = array_merge($lang, array(
'LOG_PM_REPORT_CLOSED' => '<strong>Closed PM report</strong><br />» %s',
'LOG_PM_REPORT_DELETED' => '<strong>Deleted PM report</strong><br />» %s',
'LOG_POST_APPROVED' => '<strong>Approved post</strong><br />» %s',
- 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s',
+ 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
'LOG_POST_RESTORED' => '<strong>Restored post</strong><br />» %s',
'LOG_REPORT_CLOSED' => '<strong>Closed report</strong><br />» %s',
@@ -564,7 +563,7 @@ $lang = array_merge($lang, array(
'LOG_TOPIC_APPROVED' => '<strong>Approved topic</strong><br />» %s',
'LOG_TOPIC_RESTORED' => '<strong>Restored topic</strong><br />» %s',
- 'LOG_TOPIC_DISAPPROVED' => '<strong>Disapproved topic “%1$s” with the following reason</strong><br />%2$s',
+ 'LOG_TOPIC_DISAPPROVED' => '<strong>Disapproved topic “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
'LOG_TOPIC_RESYNC' => '<strong>Resynchronised topic counters</strong><br />» %s',
'LOG_TOPIC_TYPE_CHANGED' => '<strong>Changed topic type</strong><br />» %s',
'LOG_UNLOCK' => '<strong>Unlocked topic</strong><br />» %s',
@@ -678,7 +677,6 @@ $lang = array_merge($lang, array(
'LOG_PURGE_CACHE' => '<strong>Purged cache</strong>',
'LOG_PURGE_SESSIONS' => '<strong>Purged sessions</strong>',
-
'LOG_RANK_ADDED' => '<strong>Added new rank</strong><br />» %s',
'LOG_RANK_REMOVED' => '<strong>Removed rank</strong><br />» %s',
'LOG_RANK_UPDATED' => '<strong>Updated rank</strong><br />» %s',
diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php
index baa7d01763..39881668c4 100644
--- a/phpBB/language/en/acp/extensions.php
+++ b/phpBB/language/en/acp/extensions.php
@@ -33,7 +33,6 @@ if (empty($lang) || !is_array($lang))
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
-
$lang = array_merge($lang, array(
'EXTENSION' => 'Extension',
'EXTENSIONS' => 'Extensions',
diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php
index 6e3ba6876a..36af461f87 100644
--- a/phpBB/language/en/acp/permissions.php
+++ b/phpBB/language/en/acp/permissions.php
@@ -182,7 +182,6 @@ $lang = array_merge($lang, array(
'ROLE_USER_STANDARD' => 'Standard Features',
'ROLE_USER_NEW_MEMBER' => 'Newly Registered User Features',
-
'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.',
'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all administrative functions of this board.<br />Not recommended.',
'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most administrative features but is not allowed to use server or system related tools.',
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index ea3eadb0dd..cf570d844f 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -85,8 +85,8 @@ $lang = array_merge($lang, array(
'URL' => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://” is prefixed to the string.',
'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “%s”',
'RELATIVE_URL' => 'A relative URL. You can use this to match parts of a URL, but be careful: a full URL is a valid relative URL. When you want to use relative URLs of your board, use the LOCAL_URL token.',
- 'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>'
- )
+ 'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>',
+ ),
));
// Smilies and topic icons
@@ -109,8 +109,6 @@ $lang = array_merge($lang, array(
'DISPLAY_POSTING' => 'On posting page',
'DISPLAY_POSTING_NO' => 'Not on posting page',
-
-
'EDIT_ICONS' => 'Edit icons',
'EDIT_SMILIES' => 'Edit smilies',
'EMOTION' => 'Emotion',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 677b228cc6..f78ce76050 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -1370,7 +1370,7 @@ $lang = array_merge($lang, array(
'D M d, Y g:i a' => 'Mon Jan 01, 2007 1:37 pm',
'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm',
'|d M Y|, H:i' => 'Today, 13:37 / 01 Jan 2007, 13:37',
- '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm'
+ '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm',
),
// The default dateformat which will be used on new installs in this language
diff --git a/phpBB/language/en/email/admin_activate.txt b/phpBB/language/en/email/admin_activate.txt
index 8b11f1b450..a53ab1269e 100644
--- a/phpBB/language/en/email/admin_activate.txt
+++ b/phpBB/language/en/email/admin_activate.txt
@@ -10,5 +10,4 @@ Use this link to view the user's profile:
Use this link to activate the account:
{U_ACTIVATE}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_send_email.txt b/phpBB/language/en/email/admin_send_email.txt
index b778496258..7345a040fd 100644
--- a/phpBB/language/en/email/admin_send_email.txt
+++ b/phpBB/language/en/email/admin_send_email.txt
@@ -10,5 +10,4 @@ Message sent to you follows:
{MESSAGE}
-
{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_welcome_activated.txt b/phpBB/language/en/email/admin_welcome_activated.txt
index cfdb69bdcb..2e136ac530 100644
--- a/phpBB/language/en/email/admin_welcome_activated.txt
+++ b/phpBB/language/en/email/admin_welcome_activated.txt
@@ -6,4 +6,4 @@ Your account on "{SITENAME}" has been activated by an administrator, you may log
Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_welcome_inactive.txt b/phpBB/language/en/email/admin_welcome_inactive.txt
index 8605956318..f9a57b9fe3 100644
--- a/phpBB/language/en/email/admin_welcome_inactive.txt
+++ b/phpBB/language/en/email/admin_welcome_inactive.txt
@@ -16,4 +16,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt
index 725b52f0cc..43c9098a4f 100644
--- a/phpBB/language/en/email/email_notify.txt
+++ b/phpBB/language/en/email/email_notify.txt
@@ -14,4 +14,4 @@ A message from {FROM_USERNAME} may also be included below. Please note that this
----------
-{MESSAGE} \ No newline at end of file
+{MESSAGE}
diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt
index 8f63d07635..93444581f2 100644
--- a/phpBB/language/en/email/installed.txt
+++ b/phpBB/language/en/email/installed.txt
@@ -16,4 +16,4 @@ Useful information regarding the phpBB software can be found in the docs folder
In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/pm_report_closed.txt b/phpBB/language/en/email/pm_report_closed.txt
index 1b9f4a6658..0202b9d374 100644
--- a/phpBB/language/en/email/pm_report_closed.txt
+++ b/phpBB/language/en/email/pm_report_closed.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" has been tended to by a moderator or administrator. The report is now closed. If you have further questions, please contact {CLOSER_NAME} by private message.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/pm_report_deleted.txt b/phpBB/language/en/email/pm_report_deleted.txt
index a868837841..991ed59f31 100644
--- a/phpBB/language/en/email/pm_report_deleted.txt
+++ b/phpBB/language/en/email/pm_report_deleted.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" was deleted by a moderator or administrator.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/post_approved.txt b/phpBB/language/en/email/post_approved.txt
index a02dba142a..854d785f5f 100644
--- a/phpBB/language/en/email/post_approved.txt
+++ b/phpBB/language/en/email/post_approved.txt
@@ -10,4 +10,4 @@ If you want to view the post, click the following link:
If you want to view the topic, click the following link:
{U_VIEW_TOPIC}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/post_approved.txt b/phpBB/language/en/email/short/post_approved.txt
index a02dba142a..854d785f5f 100644
--- a/phpBB/language/en/email/short/post_approved.txt
+++ b/phpBB/language/en/email/short/post_approved.txt
@@ -10,4 +10,4 @@ If you want to view the post, click the following link:
If you want to view the topic, click the following link:
{U_VIEW_TOPIC}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate.txt b/phpBB/language/en/email/user_activate.txt
index 7d7960c4c5..b949b68651 100644
--- a/phpBB/language/en/email/user_activate.txt
+++ b/phpBB/language/en/email/user_activate.txt
@@ -6,4 +6,4 @@ Your account on "{SITENAME}" has been deactivated, most likely due to changes ma
{U_ACTIVATE}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate_inactive.txt b/phpBB/language/en/email/user_activate_inactive.txt
index a90773d48c..7743420698 100644
--- a/phpBB/language/en/email/user_activate_inactive.txt
+++ b/phpBB/language/en/email/user_activate_inactive.txt
@@ -4,4 +4,4 @@ Hello {USERNAME},
Your account on "{SITENAME}" has been deactivated, most likely due to changes made to your profile. The administrator of the board will need to activate it before you can log in. You will receive another notification when this has occurred.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate_passwd.txt b/phpBB/language/en/email/user_activate_passwd.txt
index 695be115f8..965d5a552c 100644
--- a/phpBB/language/en/email/user_activate_passwd.txt
+++ b/phpBB/language/en/email/user_activate_passwd.txt
@@ -14,4 +14,4 @@ Password: {PASSWORD}
You can of course change this password yourself via the profile page. If you have any difficulties please contact the board administrator.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_reactivate_account.txt b/phpBB/language/en/email/user_reactivate_account.txt
index 385c09f4c5..7564b0a8e4 100644
--- a/phpBB/language/en/email/user_reactivate_account.txt
+++ b/phpBB/language/en/email/user_reactivate_account.txt
@@ -15,4 +15,4 @@ Please visit the following link to reactivate your account:
{U_ACTIVATE}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_remind_inactive.txt b/phpBB/language/en/email/user_remind_inactive.txt
index 1ba28329f6..1f136b56f2 100644
--- a/phpBB/language/en/email/user_remind_inactive.txt
+++ b/phpBB/language/en/email/user_remind_inactive.txt
@@ -8,4 +8,4 @@ This notification is a reminder that your account at "{SITENAME}", created on {R
Thank you for registering at "{SITENAME}", we look forward to your participation.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_resend_inactive.txt b/phpBB/language/en/email/user_resend_inactive.txt
index b9b95ce9e5..d975a07b13 100644
--- a/phpBB/language/en/email/user_resend_inactive.txt
+++ b/phpBB/language/en/email/user_resend_inactive.txt
@@ -16,4 +16,4 @@ Please visit the following link in order to activate your account:
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_welcome.txt b/phpBB/language/en/email/user_welcome.txt
index aaead86afc..f299b7b23e 100644
--- a/phpBB/language/en/email/user_welcome.txt
+++ b/phpBB/language/en/email/user_welcome.txt
@@ -14,4 +14,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_welcome_inactive.txt b/phpBB/language/en/email/user_welcome_inactive.txt
index 5cbb3af3de..b4300d0032 100644
--- a/phpBB/language/en/email/user_welcome_inactive.txt
+++ b/phpBB/language/en/email/user_welcome_inactive.txt
@@ -18,4 +18,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php
index 6155d34a8c..c36d87f793 100644
--- a/phpBB/language/en/groups.php
+++ b/phpBB/language/en/groups.php
@@ -81,7 +81,7 @@ $lang = array_merge($lang, array(
'NOT_LEADER_OF_GROUP' => 'The requested operation cannot be taken because you are not a leader of the selected group.',
'NOT_MEMBER_OF_GROUP' => 'The requested operation cannot be taken because you are not a member of the selected group or your membership has not been approved yet.',
'NOT_RESIGN_FROM_DEFAULT_GROUP' => 'You are not allowed to resign from your default group.',
-
+
'PRIMARY_GROUP' => 'Primary group',
'REMOVE_SELECTED' => 'Remove selected',
diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php
index d627ac3908..61263752b2 100644
--- a/phpBB/language/en/help_bbcode.php
+++ b/phpBB/language/en/help_bbcode.php
@@ -109,5 +109,5 @@ $help = array(
array(
0 => 'Can I add my own tags?',
1 => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.'
- )
+ ),
);
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index 94e6622685..d803ec91e4 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -337,5 +337,5 @@ $help = array(
array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',
1 => 'Any of the administrators listed on the “The team” page should be an appropriate point of contact for your complaints. If this still gets no response then you should contact the owner of the domain (do a <a href="http://www.google.com/search?q=whois">whois lookup</a>) or, if this is running on a free service (e.g. Yahoo!, free.fr, f2s.com, etc.), the management or abuse department of that service. Please note that the phpBB Group has <strong>absolutely no jurisdiction</strong> and cannot in any way be held liable over how, where or by whom this board is used. Do not contact the phpBB Group in relation to any legal (cease and desist, liable, defamatory comment, etc.) matter <strong>not directly related</strong> to the phpBB.com website or the discrete software of phpBB itself. If you do email phpBB Group <strong>about any third party</strong> use of this software then you should expect a terse response or no response at all.'
- )
+ ),
);
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index b75e0ea495..dffa40db2f 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -426,6 +426,6 @@ $lang = array_merge($lang, array(
'SPAM' => 'The reported message has the only purpose to advertise for a website or another product.',
'OFF_TOPIC' => 'The reported message is off topic.',
'OTHER' => 'The reported message does not fit into any other category, please use the further information field.',
- )
+ ),
),
));
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index c1d8cef7de..e3b6101310 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
'BBCODE_IS_OFF' => '%sBBCode%s is <em>OFF</em>',
'BBCODE_IS_ON' => '%sBBCode%s is <em>ON</em>',
'BBCODE_I_HELP' => 'Italic text: [i]text[/i]',
- 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
+ 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
'BBCODE_LISTITEM_HELP' => 'List item: [*]text',
'BBCODE_O_HELP' => 'Ordered list: e.g. [list=1][*]First point[/list] or [list=a][*]Point a[/list]',
'BBCODE_P_HELP' => 'Insert image: [img]http://image_url[/img]',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 40c8bd9f8e..79d2b9fa3a 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -412,6 +412,7 @@ $lang = array_merge($lang, array(
'PM_SENTBOX' => 'Sent messages',
'PM_SUBJECT' => 'Message subject',
'PM_TO' => 'Send to',
+ 'PM_TOOLS' => 'Message tools',
'PM_USERS_REMOVED_NO_PM' => 'Some users couldn’t be added as they have disabled private message receipt.',
'POST_EDIT_PM' => 'Edit message',
'POST_FORWARD_PM' => 'Forward message',
@@ -602,14 +603,14 @@ $lang = array_merge($lang, array(
'PLACE_INTO_FOLDER' => 'Place into folder',
'MARK_AS_READ' => 'Mark as read',
'MARK_AS_IMPORTANT' => 'Mark message',
- 'DELETE_MESSAGE' => 'Delete message'
+ 'DELETE_MESSAGE' => 'Delete message',
),
'PM_CHECK' => array(
'SUBJECT' => 'Subject',
'SENDER' => 'Sender',
'MESSAGE' => 'Message',
'STATUS' => 'Message status',
- 'TO' => 'Sent To'
+ 'TO' => 'Sent To',
),
'PM_RULE' => array(
'IS_LIKE' => 'is like',
@@ -625,10 +626,9 @@ $lang = array_merge($lang, array(
'ANSWERED' => 'answered',
'FORWARDED' => 'forwarded',
'TO_GROUP' => 'to my default usergroup',
- 'TO_ME' => 'to me'
+ 'TO_ME' => 'to me',
),
-
'GROUPS_EXPLAIN' => 'Usergroups enable board admins to better administer users. By default you will be placed in a specific group, this is your default group. This group defines how you may appear to other users, for example your username colouration, avatar, rank, etc. Depending on whether the administrator allows it you may be allowed to change your default group. You may also be placed in or allowed to join other groups. Some groups may give you additional permissions to view content or increase your capabilities in other areas.',
'GROUP_LEADER' => 'Leaderships',
'GROUP_MEMBER' => 'Memberships',
diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php
index b566f4b5c0..afbad5a0d6 100644
--- a/phpBB/language/en/viewtopic.php
+++ b/phpBB/language/en/viewtopic.php
@@ -58,7 +58,7 @@ $lang = array_merge($lang, array(
1 => 'Last edited by %2$s on %3$s, edited %1$d time in total.',
2 => 'Last edited by %2$s on %3$s, edited %1$d times in total.',
),
- 'EMAIL_TOPIC' => 'Email friend',
+ 'EMAIL_TOPIC' => 'Email topic',
'ERROR_NO_ATTACHMENT' => 'The selected attachment does not exist anymore.',
'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.',
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index 3d480b7e1c..2b0132075b 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools.php
@@ -34,6 +34,12 @@ class tools
var $dbms_type_map = array();
/**
+ * Is the used MS SQL Server a SQL Server 2000?
+ * @var bool
+ */
+ protected $is_sql_server_2000;
+
+ /**
* Get the column types for every database we support
*
* @return array
@@ -1846,50 +1852,46 @@ class tools
case 'mssql':
case 'mssqlnative':
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
- // Remove default constraints
- if ($row['mssql_version'][0] == '8') // SQL Server 2000
- {
- // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
- // Deprecated in SQL Server 2005
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT so.name FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}'))
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END";
- }
- else
- {
- $sql = "SELECT dobj.name AS def_name
- FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
+ $indexes = $this->mssql_get_existing_indexes($table_name, $column_name);
- if ($row)
+ // Drop any indexes
+ $recreate_indexes = array();
+ if (!empty($indexes))
+ {
+ foreach ($indexes as $index_name => $index_data)
{
- $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ if (sizeof($index_data) > 1)
+ {
+ // Remove this column from the index and recreate it
+ $recreate_indexes[$index_name] = array_diff($index_data, array($column_name));
+ }
}
}
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Remove the column
$statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
+
+ if (!empty($recreate_indexes))
+ {
+ // Recreate indexes after we removed the column
+ foreach ($recreate_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $this->return_statements = $old_return_statements;
break;
case 'mysql_40':
@@ -2371,53 +2373,46 @@ class tools
case 'mssql':
case 'mssqlnative':
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $indexes = $this->mssql_get_existing_indexes($table_name, $column_name);
+
+ // Drop any indexes
+ if (!empty($indexes))
+ {
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Change the column
$statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
if (!empty($column_data['default']))
{
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
+ // Add new default value constraint
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $this->db->sql_escape($column_data['default']) . ' FOR [' . $column_name . ']';
+ }
- // Using TRANSACT-SQL for this statement because we do not want to have colliding data if statements are executed at a later stage
- if ($row['mssql_version'][0] == '8') // SQL Server 2000
- {
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT so.name FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}'))
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END
- SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
- EXEC(@cmd)";
- }
- else
+ if (!empty($indexes))
+ {
+ // Recreate indexes after we changed the column
+ foreach ($indexes as $index_name => $index_data)
{
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT dobj.name FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL)
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END
- SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
- EXEC(@cmd)";
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
}
}
+
+ $this->return_statements = $old_return_statements;
break;
case 'mysql_40':
@@ -2551,4 +2546,159 @@ class tools
return $this->_sql_run_sql($statements);
}
+
+ /**
+ * Get queries to drop the default constraints of a column
+ *
+ * We need to drop the default constraints of a column,
+ * before being able to change their type or deleting them.
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @return array Array with SQL statements
+ */
+ protected function mssql_get_drop_default_constraints_queries($table_name, $column_name)
+ {
+ $statements = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT so.name AS def_name
+ FROM sysobjects so
+ JOIN sysconstraints sc ON so.id = sc.constid
+ WHERE object_name(so.parent_obj) = '{$table_name}'
+ AND so.xtype = 'D'
+ AND sc.colid = (SELECT colid FROM syscolumns
+ WHERE id = object_id('{$table_name}')
+ AND name = '{$column_name}')";
+ }
+ else
+ {
+ $sql = "SELECT dobj.name AS def_name
+ FROM sys.columns col
+ LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
+ WHERE col.object_id = object_id('{$table_name}')
+ AND col.name = '{$column_name}'
+ AND dobj.name IS NOT NULL";
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
+ }
+ $this->db->sql_freeresult($result);
+
+ return $statements;
+ }
+
+ /**
+ * Get a list with existing indexes for the column
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @return array Array with Index name => columns
+ */
+ protected function mssql_get_existing_indexes($table_name, $column_name)
+ {
+ $existing_indexes = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'";
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'";
+ }
+
+ $result = $this->db->sql_query($sql);
+ $existing_indexes = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $existing_indexes[$row['phpbb_index_name']] = array();
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($existing_indexes))
+ {
+ return array();
+ }
+
+ if ($this->mssql_is_sql_server_2000())
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $existing_indexes[$row['phpbb_index_name']][] = $row['phpbb_column_name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $existing_indexes;
+ }
+
+ /**
+ * Is the used MS SQL Server a SQL Server 2000?
+ *
+ * @return bool
+ */
+ protected function mssql_is_sql_server_2000()
+ {
+ if ($this->is_sql_server_2000 === null)
+ {
+ $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
+ $result = $this->db->sql_query($sql);
+ $properties = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ $this->is_sql_server_2000 = $properties['mssql_version'][0] == '8';
+ }
+
+ return $this->is_sql_server_2000;
+ }
}
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index e38950f4c1..24b622dbac 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -520,7 +520,7 @@ class log implements \phpbb\log\log_interface
$num_args = 0;
if (!is_array($this->user->lang[$row['log_operation']]))
{
- $num_args = substr_count($log[$i]['action'], '%');
+ $num_args = substr_count($this->user->lang[$row['log_operation']], '%');
}
else
{
diff --git a/phpBB/report.php b/phpBB/report.php
index 1adee028dc..f37a2f9d5c 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -136,7 +136,7 @@ else
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
}
-
+
$reported_post_text = $report_data['message_text'];
$reported_post_bitfield = $report_data['bbcode_bitfield'];
$reported_post_uid = $report_data['bbcode_uid'];
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index 4df38f4275..bc68e5ae0c 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -8,7 +8,7 @@
* @param int Delay in ms until darkenwrapper's click event is triggered
*/
phpbb.closeDarkenWrapper = function(delay) {
- setTimeout(function() {
+ phpbbAlertTimer = setTimeout(function() {
$('#darkenwrapper').trigger('click');
}, delay);
};
diff --git a/phpBB/styles/prosilver/template/faq_body.html b/phpBB/styles/prosilver/template/faq_body.html
index 4444272920..53205d14e9 100644
--- a/phpBB/styles/prosilver/template/faq_body.html
+++ b/phpBB/styles/prosilver/template/faq_body.html
@@ -24,10 +24,6 @@
</div>
</div>
-
-
-<div class="clear"></div>
-
<!-- BEGIN faq_block -->
<div class="panel <!-- IF faq_block.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
<div class="inner">
diff --git a/phpBB/styles/prosilver/template/mcp_footer.html b/phpBB/styles/prosilver/template/mcp_footer.html
index e5768bdc6b..89ce7c34ab 100644
--- a/phpBB/styles/prosilver/template/mcp_footer.html
+++ b/phpBB/styles/prosilver/template/mcp_footer.html
@@ -1,9 +1,8 @@
</div>
- <div class="clear"></div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 5f2da3aa80..3ef3f7ca07 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -50,14 +50,14 @@
<!-- ENDIF -->
</dl>
- <span class="clear"></span></div>
+ </div>
</div>
<!-- EVENT memberlist_view_contact_before -->
<div class="panel bg2">
<div class="inner">
- <div class="column1">
+ <div class="column1">
<h3>{L_CONTACT_USER} {USERNAME}</h3>
<dl class="details">
@@ -103,7 +103,8 @@
<!-- EVENT memberlist_view_user_statistics_after -->
</dl>
</div>
- <span class="clear"></span></div>
+
+ </div>
</div>
<!-- EVENT memberlist_view_contact_after -->
@@ -115,7 +116,7 @@
<div class="postbody"><div class="signature standalone">{SIGNATURE}</div></div>
- <span class="clear"></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
index d10976c0da..7fbaa1254f 100644
--- a/phpBB/styles/prosilver/template/navbar_header.html
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -11,10 +11,6 @@
</li>
<!-- IF S_REGISTERED_USER --><li id="username_logged_in" class="rightside"><!-- IF CURRENT_USER_AVATAR --><a href="{U_USER_PROFILE}" class="header-avatar">{CURRENT_USER_AVATAR}</a> <!-- ENDIF -->{USERNAME_FULL}</li><!-- ENDIF -->
- <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
- <!-- IF U_PRINT_TOPIC --><li class="rightside"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p" class="print">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p" class="print">{L_PRINT_PM}</a></li><!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --><li class="responsive-search rightside" style="display: none;"><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH}</a></li><!-- ENDIF -->
</ul>
diff --git a/phpBB/styles/prosilver/template/posting_pm_header.html b/phpBB/styles/prosilver/template/posting_pm_header.html
index 114b361e9a..dea50b5daf 100644
--- a/phpBB/styles/prosilver/template/posting_pm_header.html
+++ b/phpBB/styles/prosilver/template/posting_pm_header.html
@@ -76,7 +76,6 @@
</dl>
</div>
<!-- ENDIF -->
-
- <div class="clear"></div>
+
<!-- ENDIF -->
</fieldset>
diff --git a/phpBB/styles/prosilver/template/ucp_footer.html b/phpBB/styles/prosilver/template/ucp_footer.html
index ea546f7a82..f2f1a68db3 100644
--- a/phpBB/styles/prosilver/template/ucp_footer.html
+++ b/phpBB/styles/prosilver/template/ucp_footer.html
@@ -1,9 +1,8 @@
</div>
- <div class="clear"></div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_COMPOSE_PM -->
<div>{S_FORM_TOKEN}</div>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
index a6ef3fc7dd..840eba4c83 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
@@ -15,6 +15,18 @@
</div>
<!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_PRINT_PM -->
+ <div class="dropdown-container dropdown-button-control topic-tools">
+ <span title="{L_PM_TOOLS}" class="dropdown-trigger dropdown-select dropdown-select-icon tools-icon"><span></span></span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- IF U_PRINT_PM --><li class="small-icon icon-print"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p">{L_PRINT_PM}</a></li><!-- ENDIF -->
+ </ul>
+ </div>
+ </div>
+ <!-- ENDIF -->
+
<!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
<ul class="linklist">
<li class="rightside pagination">
diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
index fcce2267c4..89f34d1b3a 100644
--- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
+++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
@@ -1,4 +1,4 @@
-<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or S_HAS_ATTACHMENTS or S_DISPLAY_TOPIC_TOOLS) -->
+<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or S_HAS_ATTACHMENTS or U_EMAIL_TOPIC or U_PRINT_TOPIC or S_DISPLAY_TOPIC_TOOLS) -->
<div class="dropdown-container dropdown-button-control topic-tools">
<span title="{L_TOPIC_TOOLS}" class="dropdown-trigger dropdown-select dropdown-select-icon tools-icon"><span></span></span>
<div class="dropdown hidden">
@@ -20,6 +20,8 @@
</li>
<!-- ENDIF -->
<!-- IF U_BUMP_TOPIC --><li class="small-icon icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}" data-ajax="true">{L_BUMP_TOPIC}</a></li><!-- ENDIF -->
+ <!-- IF U_EMAIL_TOPIC --><li class="small-icon icon-sendemail"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
+ <!-- IF U_PRINT_TOPIC --><li class="small-icon icon-print"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
<!-- IF S_HAS_ATTACHMENTS -->
<li class="small-icon icon-download">
<a class="dropdown-toggle-submenu" href="{U_DOWNLOAD_ALL_ATTACHMENTS}" title="{L_DOWNLOAD_ALL_ATTACHMENTS}">{L_DOWNLOAD_ALL_ATTACHMENTS}</a>
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index 850726db89..0d5e1cf829 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -552,12 +552,6 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
margin: 0 1px 0 5px;
}
-/* Sub-header (navigation bar)
---------------------------------------------- */
-.rtl a.print, .rtl a.sendemail {
- text-align: right;
-}
-
/* Icon images
---------------------------------------- */
.rtl .small-icon {
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index 93c325e416..3422af8b64 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -101,27 +101,6 @@
.dropdown-visible .dropdown-select.tools-icon:before,
.nojs .dropdown-container:hover .dropdown-select.tools-icon:before { background-position: -80px -20px; }
-/* Sub-header (navigation bar)
---------------------------------------------- */
-a.print, a.sendemail {
- display: block;
- overflow: hidden;
- height: 18px;
- text-indent: -5000px;
- text-align: left;
- background-repeat: no-repeat;
-}
-
-a.print {
- background-image: none;
- width: 22px;
-}
-
-a.sendemail {
- background-image: none;
- width: 22px;
-}
-
/* Icon images
---------------------------------------- */
.small-icon {
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 5f6ca4929c..30650e7411 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -665,14 +665,6 @@ fieldset.polls dd div {
Colours and backgrounds for buttons.css
-------------------------------------------------------------- */
-a.print {
- background-image: url("./images/icon_print.gif");
-}
-
-a.sendemail {
- background-image: url("./images/icon_sendemail.gif");
-}
-
.buttons div a, .dropdown-select {
border-color: #C7C3BF;
background-color: #FFFFFF;
@@ -736,6 +728,8 @@ a.sendemail {
.icon-pm { background-image: url("./images/icon_pm.gif"); }
.icon-download { background-image: url("./images/icon_download.gif"); }
.icon-mark { background-image: url("./images/icon_mark.gif"); }
+.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); }
+.icon-print { background-image: url("./images/icon_print.gif"); }
/* Profile & navigation icons */
.email-icon, .email-icon a { background-image: url("./images/icon_contact_email.gif"); }
diff --git a/phpBB/styles/prosilver/theme/images/icon_print.gif b/phpBB/styles/prosilver/theme/images/icon_print.gif
index a71dfdde70..e464e304ea 100644..100755
--- a/phpBB/styles/prosilver/theme/images/icon_print.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_print.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_sendemail.gif b/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
index f6b8aa10e1..92a39c8af9 100644
--- a/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
Binary files differ
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 9dc965240f..f5e86c6b40 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1879,7 +1879,7 @@ $page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang
* You can use this event to modify the page title of the viewtopic page
*
* @event core.viewtopic_modify_page_title
-* @var string page_title Title of the index page
+* @var string page_title Title of the viewtopic page
* @var array topic_data Array with topic data
* @var int forum_id Forum ID of the topic
* @var int start Start offset used to calculate the page
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index e25335165a..df8f22083b 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -11,7 +11,9 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_dbal_db_tools_test extends phpbb_database_test_case
{
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
+ /** @var \phpbb\db\tools */
protected $tools;
protected $table_exists;
protected $table_data;
@@ -207,6 +209,32 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'column_does_not_exist'));
}
+ public function test_column_change_with_index()
+ {
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12012', array('DECIMAL', 0)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+
+ // Create index over the column
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012', array('c_bug_12012', 'c_bool')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+
+ // Change type from int to string
+ $this->assertTrue($this->tools->sql_column_change('prefix_table_name', 'c_bug_12012', array('VCHAR:100', '')));
+
+ // Remove the index
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+ $this->assertTrue($this->tools->sql_index_drop('prefix_table_name', 'i_bug_12012'));
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+
+ // Remove the column
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_bug_12012'));
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ }
+
public function test_column_remove()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
@@ -216,6 +244,28 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
}
+ public function test_column_remove_with_index()
+ {
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12012_2', array('UINT', 4)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+
+ // Create index over the column
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012_2', array('c_bug_12012_2', 'c_bool')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_2'));
+
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_3'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012_3', array('c_bug_12012_2')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_3'));
+
+ // Remove the column
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ }
+
public function test_column_remove_primary()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
@@ -252,7 +302,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_table_exists('prefix_test_table'));
}
- public function test_peform_schema_changes_drop_tables()
+ public function test_perform_schema_changes_drop_tables()
{
$db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_table_exists',
@@ -278,7 +328,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
));
}
- public function test_peform_schema_changes_drop_columns()
+ public function test_perform_schema_changes_drop_columns()
{
$db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_column_exists',
diff --git a/tests/functions/validate_with_method_test.php b/tests/functions/validate_with_method_test.php
new file mode 100644
index 0000000000..86d7b9571c
--- /dev/null
+++ b/tests/functions/validate_with_method_test.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_with_method_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_date()
+ {
+ $this->helper->assert_valid_data(array(
+ 'method_call' => array(
+ array(),
+ true,
+ array(array(array($this, 'with_method'), false)),
+ ),
+ ));
+ }
+
+ public function validate_with_method($bool, $optional = false)
+ {
+ return ! $bool;
+ }
+}
diff --git a/tests/log/fixtures/full_log.xml b/tests/log/fixtures/full_log.xml
index 4e5538d5a9..ef35884444 100644
--- a/tests/log/fixtures/full_log.xml
+++ b/tests/log/fixtures/full_log.xml
@@ -131,6 +131,18 @@
<value>LOG_SINGULAR_PLURAL</value>
<value>a:1:{i:0;i:2;}</value>
</row>
+ <row>
+ <value>11</value>
+ <value>1</value>
+ <value>1</value>
+ <value>15</value>
+ <value>3</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD3</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
</table>
<table name="phpbb_users">
<column>user_id</column>
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 2f64459062..542d0adf9d 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -225,6 +225,27 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'viewforum' => '',
'action' => 'LOG_SINGULAR_PLURAL 2',
),
+ 11 => array(
+ 'id' => 11,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => 'Anonymous',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 15,
+ 'topic_id' => 3,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_MOD3 guest ',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
);
$test_cases = array(
@@ -310,6 +331,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'expected_returned' => 0,
'user', false, 5, 0, 0, 0, 0, 0, 'l.log_id ASC', 'plural',
),
+ array(
+ 'expected' => array(11),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 15, 3,
+ ),
);
foreach ($test_cases as $case => $case_data)
@@ -362,6 +388,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'LOG_INSTALL_INSTALLED' => 'installed: %s',
'LOG_USER' => 'User<br /> %s',
'LOG_MOD2' => 'Mod2',
+ 'LOG_MOD3' => 'Mod3: %1$s, %2$s',
'LOG_SINGULAR_PLURAL' => array(
1 => 'singular',
2 => 'plural (%d)',
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
new file mode 100644
index 0000000000..4fdba859f3
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
@@ -0,0 +1,2 @@
+[{event_loop.S_ROW_COUNT}<!-- BEGIN subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
+<!-- END subloop -->]
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
new file mode 100644
index 0000000000..233b32a4c7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_subloop -->
+<!-- END event_loop -->
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 41e00e86a7..d09f22944f 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -90,14 +90,33 @@ Zeta test event in all',
array(),
'event_loop0|event_loop1|event_loop2',
),
+ array(
+ 'EVENT with subloop in loop',
+ 'ext_trivial',
+ array('silver'),
+ 'event_subloop.html',
+ array(),
+ array(
+ 'event_loop' => array(array()),
+ 'event_loop.subloop' => array(array()),
+ ),
+ array(),
+ 'event_loop[0[subloop:0]]',
+ 'Event files are missing opened parent loops: PHPBB3-12382',
+ ),
);
}
/**
* @dataProvider template_data
*/
- public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected)
+ public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected, $incomplete_message = '')
{
+ if ($incomplete_message)
+ {
+ $this->markTestIncomplete($incomplete_message);
+ }
+
// Reset the engine state
$this->setup_engine_for_events($dataset, $style_names);
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 74baa3d5b6..49804c26c5 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -320,6 +320,18 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(),
"barbarbar1bar1",
),
+ array(
+ 'loop_nested_include.html',
+ array(),
+ array(
+ 'test_loop' => array(array('foo' => 'bar'), array('foo' => 'bar1')),
+ 'test_loop.inner' => array(array('myinner' => 'works')),
+ ),
+ array(),
+ "[bar|[bar|]][bar1|[bar1|[bar1|works]]]",
+ array(),
+ 'Included files are missing opened parent loops: PHPBB3-12382',
+ ),
/* Does not pass with the current implementation.
array(
'loop_reuse.html',
@@ -363,8 +375,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
/**
* @dataProvider template_data
*/
- public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array())
+ public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array(), $incomplete_message = '')
{
+ if ($incomplete_message)
+ {
+ $this->markTestIncomplete($incomplete_message);
+ }
+
$this->run_template($file, $vars, $block_vars, $destroy, $expected, $lang_vars);
}
diff --git a/tests/template/templates/loop_nested_include.html b/tests/template/templates/loop_nested_include.html
new file mode 100644
index 0000000000..eaad46cc5b
--- /dev/null
+++ b/tests/template/templates/loop_nested_include.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+[{test_loop.foo}
+ |<!-- INCLUDE loop_nested_include1.html -->]
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_nested_include1.html b/tests/template/templates/loop_nested_include1.html
new file mode 100644
index 0000000000..0f1a180b4d
--- /dev/null
+++ b/tests/template/templates/loop_nested_include1.html
@@ -0,0 +1,5 @@
+[{test_loop.foo}|
+<!-- BEGIN inner -->
+[{test_loop.foo}|
+{test_loop.inner.myinner}]
+<!-- END inner -->]
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index f6429b1ccb..887dad5b50 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -12,8 +12,11 @@ require_once dirname(__FILE__) . '/phpbb_database_connection_odbc_pdo_wrapper.ph
class phpbb_database_test_connection_manager
{
+ /** @var array */
private $config;
+ /** @var array */
private $dbms;
+ /** @var \PDO */
private $pdo;
/**
@@ -363,9 +366,21 @@ class phpbb_database_test_connection_manager
$table_name,
$table_data
);
+
foreach ($queries as $query)
{
- $this->pdo->exec($query);
+ if ($query === 'begin')
+ {
+ $this->pdo->beginTransaction();
+ }
+ else if ($query === 'commit')
+ {
+ $this->pdo->commit();
+ }
+ else
+ {
+ $this->pdo->exec($query);
+ }
}
}
}