aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/acp_email.php2
-rwxr-xr-xphpBB/includes/acp/acp_inactive.php4
-rw-r--r--phpBB/includes/acp/acp_language.php125
-rw-r--r--phpBB/includes/acp/acp_users.php14
-rw-r--r--phpBB/includes/db/mysql.php2
-rw-r--r--phpBB/includes/functions_jabber.php2
-rw-r--r--phpBB/includes/functions_messenger.php19
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/functions_privmsgs.php4
-rw-r--r--phpBB/includes/functions_user.php5
-rw-r--r--phpBB/includes/mcp/mcp_queue.php8
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php4
-rw-r--r--phpBB/includes/ucp/ucp_activate.php5
-rw-r--r--phpBB/includes/ucp/ucp_groups.php4
-rw-r--r--phpBB/includes/ucp/ucp_profile.php5
-rw-r--r--phpBB/includes/ucp/ucp_register.php8
-rw-r--r--phpBB/includes/ucp/ucp_remind.php7
-rw-r--r--phpBB/includes/ucp/ucp_resend.php8
-rwxr-xr-xphpBB/install/install_install.php4
-rw-r--r--phpBB/memberlist.php2
20 files changed, 84 insertions, 152 deletions
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 81e1e52ea4..54f9816dea 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -155,9 +155,7 @@ class acp_email
$messenger->set_mail_priority($priority);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'CONTACT_EMAIL' => $config['board_contact'],
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
'MESSAGE' => utf8_html_entity_decode($message))
);
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index 616360f422..5404393f69 100755
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -96,7 +96,6 @@ class acp_inactive
$messenger = new messenger();
$board_url = generate_board_url() . "/ucp.$phpEx?mode=activate";
- $sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
$usernames = array();
do
@@ -108,11 +107,8 @@ class acp_inactive
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($sig),
'USERNAME' => utf8_html_entity_decode($row['username']),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
-
'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
);
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 39fbc057bc..f57a2688b0 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -156,7 +156,7 @@ class acp_language
case 'download_file':
case 'upload_data':
- if (!$lang_id || !isset($_POST['entry']) || !is_array($_POST['entry']))
+ if (!$lang_id || empty($_POST['entry']))
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -497,7 +497,7 @@ class acp_language
'S_MISSING_FILES' => true,
'L_MISSING_FILES' => sprintf($user->lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']),
'MISSING_FILES' => implode('<br />', $missing_files))
- );
+ );
}
if ($is_missing_var)
@@ -506,7 +506,7 @@ class acp_language
'S_MISSING_VARS' => true,
'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
'U_MISSING_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id")
- );
+ );
foreach ($missing_vars as $file => $vars)
{
@@ -538,7 +538,7 @@ class acp_language
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
}
-
+
// Help Files
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
foreach ($this->main_files as $file)
@@ -565,7 +565,7 @@ class acp_language
}
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
-
+
foreach (${$check . '_files'} as $file)
{
$prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
@@ -605,6 +605,7 @@ class acp_language
unset($help);
}
}
+
$print_message = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file;
}
@@ -617,7 +618,7 @@ class acp_language
'PRINT_MESSAGE' => $print_message,
)
);
-
+
if (!$is_email_file)
{
$method = ($is_help_file) ? 'print_help_entries' : 'print_language_entries';
@@ -628,7 +629,7 @@ class acp_language
{
$tpl .= $this->$method($missing_vars[$name], '* ');
}
-
+
$tpl .= $this->$method($lang);
$template->assign_var('TPL', $tpl);
@@ -639,20 +640,21 @@ class acp_language
$template->assign_vars(array(
'LANG' => $lang)
);
+
unset($lang);
}
return;
-
+
break;
case 'delete':
-
+
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
+
$sql = 'SELECT *
FROM ' . LANG_TABLE . '
WHERE lang_id = ' . $lang_id;
@@ -668,12 +670,12 @@ class acp_language
$db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_lang = '{$config['default_lang']}'
- WHERE user_lang = '{$row['lang_iso']}'";
+ SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
+ WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
$db->sql_query($sql);
-
+
add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
-
+
trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
break;
@@ -691,8 +693,8 @@ class acp_language
$lang_pack = array(
'iso' => $lang_iso,
'name' => trim(htmlspecialchars($file[0])),
- 'local_name'=> trim(htmlspecialchars($file[1])),
- 'author' => trim(htmlspecialchars($file[2]))
+ 'local_name'=> trim(htmlspecialchars($file[1], ENT_COMPAT, 'UTF-8')),
+ 'author' => trim(htmlspecialchars($file[2], ENT_COMPAT, 'UTF-8'))
);
unset($file);
@@ -700,18 +702,19 @@ class acp_language
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
$result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if ($row = $db->sql_fetchrow($result))
+ if (!$row)
{
trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $db->sql_freeresult($result);
if (!$lang_pack['name'] || !$lang_pack['local_name'])
{
trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
+
// Add language pack
$sql_ary = array(
'lang_iso' => $lang_pack['iso'],
@@ -722,15 +725,15 @@ class acp_language
);
$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
-
+
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
-
+
trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
break;
case 'download':
-
+
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -753,7 +756,7 @@ class acp_language
{
continue;
}
-
+
$methods[] = $type;
}
@@ -774,7 +777,7 @@ class acp_language
'U_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id",
'RADIO_BUTTONS' => $radio_buttons)
);
-
+
return;
}
@@ -828,7 +831,7 @@ class acp_language
// Write ISO File
$iso_src = html_entity_decode($row['lang_english_name']) . "\n";
$iso_src .= utf8_html_entity_decode($row['lang_local_name']) . "\n";
- $iso_src .= html_entity_decode($row['lang_author']);
+ $iso_src .= utf8_html_entity_decode($row['lang_author']);
$compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt');
// index.html files
@@ -876,18 +879,16 @@ class acp_language
$tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : '';
$template->assign_block_vars('lang', array(
- 'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
- 'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
- 'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
-
- 'ENGLISH_NAME' => $row['lang_english_name'],
- 'TAG' => $tagstyle,
- 'LOCAL_NAME' => $row['lang_local_name'],
- 'ISO' => $row['lang_iso'],
- 'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0,
-
- )
- );
+ 'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
+ 'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
+ 'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
+
+ 'ENGLISH_NAME' => $row['lang_english_name'],
+ 'TAG' => $tagstyle,
+ 'LOCAL_NAME' => $row['lang_local_name'],
+ 'ISO' => $row['lang_iso'],
+ 'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0,
+ ));
}
$db->sql_freeresult($result);
@@ -923,14 +924,14 @@ class acp_language
foreach ($new_ary as $iso => $lang_ary)
{
$template->assign_block_vars('notinst', array(
- 'ISO' => $lang_ary['iso'],
- 'LOCAL_NAME' => $lang_ary['local_name'],
- 'NAME' => $lang_ary['name'],
+ 'ISO' => htmlspecialchars($lang_ary['iso']),
+ 'LOCAL_NAME' => htmlspecialchars($lang_ary['local_name'], ENT_COMPAT, 'UTF-8'),
+ 'NAME' => htmlspecialchars($lang_ary['name'], ENT_COMPAT, 'UTF-8'),
'U_INSTALL' => $this->u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']))
);
}
}
-
+
unset($new_ary);
}
@@ -948,7 +949,7 @@ class acp_language
* {FILENAME} [{LANG_NAME}]
*
* @package language
-* @copyright (c) 2005 phpBB Group
+* @copyright (c) 2006 phpBB Group
* @author {CHANGED} - {AUTHOR}
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -1040,7 +1041,7 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
- <td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td>
+ <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($value as $_key => $_value)
@@ -1049,23 +1050,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
- <td class="row3" colspan="2">' . $key_prefix . '&nbsp; &nbsp;<b>' . $_key . '</b></td>
+ <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '&nbsp; &nbsp;<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($_value as $__key => $__value)
{
$tpl .= '
<tr>
- <td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $__key . '</b></td>
+ <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
- $tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . '][' . $__key . ']" value="' . htmlspecialchars($__value) . '" size="50" />';
+ $tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
- $tpl .= '<b>' . htmlspecialchars($__value) . '</b>';
+ $tpl .= '<b>' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@@ -1076,16 +1077,16 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
- <td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td>
+ <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
-
+
if ($input_field)
{
- $tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . ']" value="' . htmlspecialchars($_value) . '" size="50" />';
+ $tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
- $tpl .= '<b>' . htmlspecialchars($_value) . '</b>';
+ $tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@@ -1102,16 +1103,16 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
- <td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td>
+ <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
- $tpl .= '<input type="text" name="entry[' . $key . ']" value="' . htmlspecialchars($value) . '" size="50" />';
+ $tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
- $tpl .= '<b>' . htmlspecialchars($value) . '</b>';
+ $tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@@ -1135,23 +1136,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
- <td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td>
+ <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($value as $_key => $_value)
{
$tpl .= '
<tr>
- <td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td>
+ <td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($text_field)
{
- $tpl .= '<textarea name="entry[' . $key . '][' . $_key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value) . '</textarea>';
+ $tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</textarea>';
}
else
{
- $tpl .= '<b>' . htmlspecialchars($_value) . '</b>';
+ $tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@@ -1167,23 +1168,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
- <td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td>
+ <td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($text_field)
{
- $tpl .= '<textarea name="entry[' . $key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value) . '</textarea>';
+ $tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</textarea>';
}
else
{
- $tpl .= '<b>' . htmlspecialchars($value) . '</b>';
+ $tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
</tr>';
}
}
-
+
return $tpl;
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index ac832d14e3..77edefee69 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -305,11 +305,8 @@ class acp_users
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'WELCOME_MSG' => utf8_html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => utf8_html_entity_decode($user_row['username']),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
@@ -640,7 +637,8 @@ class acp_users
// We use user within the form to circumvent auto filling
$data['username'] = $data['user'];
- unset($data['user']);
+ $data['email'] = $data['user_email'];
+ unset($data['user'], $data['user_email']);
// Validation data - we do not check the password complexity setting here
$var_ary = array(
@@ -662,10 +660,10 @@ class acp_users
}
// Check email if altered
- if ($data['user_email'] != $user_row['user_email'])
+ if ($data['email'] != $user_row['user_email'])
{
$var_ary += array(
- 'user_email' => array(
+ 'email' => array(
array('string', false, 6, 60),
array('email', $user_row['user_email'])
),
@@ -680,7 +678,7 @@ class acp_users
$error[] = 'NEW_PASSWORD_ERROR';
}
- if ($data['user_email'] != $user_row['user_email'] && $data['email_confirm'] != $data['user_email'])
+ if ($data['email'] != $user_row['user_email'] && $data['email_confirm'] != $data['email'])
{
$error[] = 'NEW_EMAIL_ERROR';
}
@@ -689,7 +687,7 @@ class acp_users
$update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false;
$update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
$update_password = ($data['user_password'] && $user_row['user_password'] != md5($data['user_password'])) ? true : false;
- $update_email = ($data['user_email'] != $user_row['user_email']) ? $data['user_email'] : false;
+ $update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
{
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 56d8a419c8..89a6e21d70 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -42,6 +42,8 @@ class dbal_mysql extends dbal
$this->server = $sqlserver . (($port) ? ':' . $port : '');
$this->dbname = $database;
+ $this->sql_layer = 'mysql4';
+
$this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword) : @mysql_connect($this->server, $this->user, $sqlpassword);
if ($this->db_connect_id && $this->dbname != '')
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 1bdeb6eb40..726985e631 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -815,7 +815,7 @@ class jabber
{
$this->stream_id = $incoming_array['stream:stream']['@']['id'];
- if ($incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-tls')
+ if (!empty($incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns']) && $incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-tls')
{
return $this->_starttls();
}
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 836345d1b9..327ed2955a 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -189,24 +189,17 @@ class messenger
{
global $config, $user;
+ // We add some standard variables we always use, no need to specify them always
+ $this->vars['U_BOARD'] = (!isset($this->vars['U_BOARD'])) ? generate_board_url() : $this->vars['U_BOARD'];
+ $this->vars['EMAIL_SIG'] = (!isset($this->vars['EMAIL_SIG'])) ? str_replace('<br />', "\n", "-- \n" . utf8_html_entity_decode($config['board_email_sig'])) : $this->vars['EMAIL_SIG'];
+ $this->vars['SITENAME'] = (!isset($this->vars['SITENAME'])) ? utf8_html_entity_decode($config['sitename']) : $this->vars['SITENAME'];
+
// Escape all quotes, else the eval will fail.
$this->msg = str_replace ("'", "\'", $this->msg);
- $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . $\\1 . '", $this->msg);
-
- // Set vars
- foreach ($this->vars as $key => $val)
- {
- $$key = $val;
- }
+ $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . ((isset(\$this->vars['\\1'])) ? \$this->vars['\\1'] : '') . '", $this->msg);
eval("\$this->msg = '$this->msg';");
- // Clear vars
- foreach ($this->vars as $key => $val)
- {
- unset($$key);
- }
-
// We now try and pull a subject from the email body ... if it exists,
// do this here because the subject may contain a variable
$drop_header = '';
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 141d4813e2..97beba9cbd 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1090,8 +1090,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
$msg_list_ary = array();
foreach ($msg_users as $row)
{
@@ -1116,8 +1114,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
$messenger->im($addr['jabber'], $addr['name']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($addr['name']),
'TOPIC_TITLE' => utf8_html_entity_decode($topic_title),
'FORUM_NAME' => utf8_html_entity_decode($forum_name),
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 9eefcf9174..604ce308e8 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1587,8 +1587,6 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger();
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
foreach ($msg_list_ary as $pos => $addr)
{
$messenger->template('privmsg_notify', $addr['lang']);
@@ -1598,8 +1596,6 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
$messenger->im($addr['jabber'], $addr['name']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'SUBJECT' => utf8_html_entity_decode($subject),
'AUTHOR_NAME' => utf8_html_entity_decode($author),
'USERNAME' => utf8_html_entity_decode($addr['name']),
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 07416887ba..6be4a26182 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2000,8 +2000,6 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger();
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
foreach ($email_users as $row)
{
$messenger->template('group_approved', $row['user_lang']);
@@ -2011,11 +2009,8 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($row['username']),
'GROUP_NAME' => utf8_html_entity_decode($group_name),
-
'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership")
);
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index e43a861cb9..e1721fd1f4 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -519,8 +519,6 @@ function approve_post($post_id_list, $mode)
// Notify Poster?
if ($notify_poster)
{
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
foreach ($post_info as $post_id => $post_data)
{
if ($post_data['poster_id'] == ANONYMOUS)
@@ -537,8 +535,6 @@ function approve_post($post_id_list, $mode)
$messenger->im($post_data['user_jabber'], $post_data['username']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($post_data['username']),
'POST_SUBJECT' => utf8_html_entity_decode(censor_text($post_data['post_subject'])),
'TOPIC_TITLE' => utf8_html_entity_decode(censor_text($post_data['topic_title'])),
@@ -734,8 +730,6 @@ function disapprove_post($post_id_list, $mode)
// Notify Poster?
if ($notify_poster)
{
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
foreach ($post_info as $post_id => $post_data)
{
if ($post_data['poster_id'] == ANONYMOUS)
@@ -752,8 +746,6 @@ function disapprove_post($post_id_list, $mode)
$messenger->im($post_data['user_jabber'], $post_data['username']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($post_data['username']),
'REASON' => utf8_html_entity_decode($disapprove_reason),
'POST_SUBJECT' => utf8_html_entity_decode(censor_text($post_data['post_subject'])),
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index f9103dcd40..78ac590706 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -475,8 +475,6 @@ function close_report($post_id_list, $mode, $action)
// Notify reporters
if (sizeof($notify_reporters))
{
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
foreach ($notify_reporters as $post_id => $reporter)
{
if ($reporter['user_id'] == ANONYMOUS)
@@ -491,8 +489,6 @@ function close_report($post_id_list, $mode, $action)
$messenger->im($reporter['user_jabber'], $reporter['username']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($reporter['username']),
'CLOSER_NAME' => utf8_html_entity_decode($user->data['username']),
'POST_SUBJECT' => utf8_html_entity_decode(censor_text($post_info[$post_id]['post_subject'])),
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 6a23498fe6..ae37dc1fa8 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -93,10 +93,7 @@ class ucp_activate
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
- 'USERNAME' => utf8_html_entity_decode($user_row['username']),
-
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])))
+ 'USERNAME' => utf8_html_entity_decode($user_row['username']))
);
$messenger->send($user_row['user_notify_type']);
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index aad6bbc45a..9b698064ce 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -172,8 +172,6 @@ class ucp_groups
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger();
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
-
$sql = 'SELECT u.username, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u
WHERE ug.user_id = u.user_id
@@ -190,8 +188,6 @@ class ucp_groups
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
- 'EMAIL_SIG' => utf8_html_entity_decode($email_sig),
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($row['username']),
'GROUP_NAME' => utf8_html_entity_decode($group_row[$group_id]['group_name']),
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 671cb6fac1..861e86d94d 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -144,10 +144,7 @@ class ucp_profile
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'USERNAME' => utf8_html_entity_decode($username),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);
@@ -181,8 +178,6 @@ class ucp_profile
$messenger->assign_vars(array(
'USERNAME' => utf8_html_entity_decode($username),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 2bc26bed78..6a889e4c3c 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -336,12 +336,9 @@ class ucp_register
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'WELCOME_MSG' => utf8_html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => utf8_html_entity_decode($data['username']),
'PASSWORD' => html_entity_decode($data['new_password']),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
);
@@ -350,8 +347,7 @@ class ucp_register
$messenger->assign_vars(array(
'FAX_INFO' => $config['coppa_fax'],
'MAIL_INFO' => $config['coppa_mail'],
- 'EMAIL_ADDRESS' => $data['email'],
- 'SITENAME' => utf8_html_entity_decode($config['sitename']))
+ 'EMAIL_ADDRESS' => $data['email'])
);
}
@@ -385,8 +381,6 @@ class ucp_register
$messenger->assign_vars(array(
'USERNAME' => utf8_html_entity_decode($data['username']),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
);
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index 1f9db8f28b..72eed6f33e 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -69,11 +69,8 @@ class ucp_remind
$messenger->im($user_row['user_jabber'], $user_row['username']);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
- 'USERNAME' => utf8_html_entity_decode($user_row['username']),
- 'PASSWORD' => html_entity_decode($user_password),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
+ 'USERNAME' => utf8_html_entity_decode($user_row['username']),
+ 'PASSWORD' => html_entity_decode($user_password),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index afa58f4e1b..ad104371a1 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -77,11 +77,8 @@ class ucp_resend
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'WELCOME_MSG' => utf8_html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => utf8_html_entity_decode($user_row['username']),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);
@@ -90,8 +87,7 @@ class ucp_resend
$messenger->assign_vars(array(
'FAX_INFO' => $config['coppa_fax'],
'MAIL_INFO' => $config['coppa_mail'],
- 'EMAIL_ADDRESS' => $user_row['user_email'],
- 'SITENAME' => $config['sitename'])
+ 'EMAIL_ADDRESS' => $user_row['user_email'])
);
}
@@ -117,8 +113,6 @@ class ucp_resend
$messenger->assign_vars(array(
'USERNAME' => utf8_html_entity_decode($user_row['username']),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])),
-
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 43ab7aa4ef..2fda22ddeb 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1625,9 +1625,7 @@ class install_install extends module
$messenger->assign_vars(array(
'USERNAME' => utf8_html_entity_decode($admin_name),
- 'PASSWORD' => html_entity_decode($admin_pass1),
- 'U_BOARD' => generate_board_url(),
- 'EMAIL_SIG' => utf8_html_entity_decode(str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])))
+ 'PASSWORD' => html_entity_decode($admin_pass1))
);
$messenger->send(NOTIFY_EMAIL);
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index e635487ff1..e73277e5a0 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -304,7 +304,6 @@ switch ($mode)
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'BOARD_EMAIL' => $config['board_contact'],
'FROM_USERNAME' => utf8_html_entity_decode($user->data['username']),
'TO_USERNAME' => utf8_html_entity_decode($row['username']),
@@ -743,7 +742,6 @@ switch ($mode)
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
- 'SITENAME' => utf8_html_entity_decode($config['sitename']),
'BOARD_EMAIL' => $config['board_contact'],
'TO_USERNAME' => utf8_html_entity_decode($row['to_name']),
'FROM_USERNAME' => utf8_html_entity_decode($user->data['username']),