aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_forums.html12
-rw-r--r--phpBB/common.php9
-rw-r--r--phpBB/develop/mysql_upgrader.php2
-rw-r--r--phpBB/download/file.php2
-rw-r--r--phpBB/includes/captcha/captcha_gd.php2
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php13
-rw-r--r--phpBB/includes/db/db_tools.php262
-rw-r--r--phpBB/includes/db/dbal.php2
-rw-r--r--phpBB/includes/db/mssqlnative.php2
-rw-r--r--phpBB/includes/functions.php27
-rw-r--r--phpBB/includes/functions_display.php1
-rw-r--r--phpBB/includes/session.php6
-rw-r--r--phpBB/includes/ucp/ucp_activate.php7
-rw-r--r--phpBB/includes/ucp/ucp_pm.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php31
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php3
-rw-r--r--phpBB/install/database_update.php2
-rw-r--r--phpBB/install/index.php2
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/language/en/captcha_recaptcha.php6
-rw-r--r--phpBB/language/en/common.php3
-rw-r--r--phpBB/language/en/mcp.php5
-rw-r--r--phpBB/language/en/memberlist.php1
-rw-r--r--phpBB/language/en/ucp.php1
-rw-r--r--phpBB/style.php2
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html2
-rw-r--r--phpBB/ucp.php6
29 files changed, 372 insertions, 49 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index d27cea28f7..9201736085 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -140,6 +140,12 @@
<dt><label for="parent">{L_FORUM_PARENT}:</label></dt>
<dd><select id="parent" name="forum_parent_id"><option value="0"<!-- IF not S_FORUM_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd>
</dl>
+ <!-- IF S_CAN_COPY_PERMISSIONS -->
+ <dl>
+ <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
+ <dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
+ </dl>
+ <!-- ENDIF -->
<dl>
<dt><label for="forum_name">{L_FORUM_NAME}:</label></dt>
<dd><input class="text medium" type="text" id="forum_name" name="forum_name" value="{FORUM_NAME}" maxlength="255" /></dd>
@@ -176,12 +182,6 @@
<dt><label for="forum_style">{L_FORUM_STYLE}:</label></dt>
<dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd>
</dl>
- <!-- IF S_CAN_COPY_PERMISSIONS -->
- <dl>
- <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
- <dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
- </dl>
- <!-- ENDIF -->
</fieldset>
<div id="forum_cat_options">
diff --git a/phpBB/common.php b/phpBB/common.php
index ae174c8441..a176a45c38 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -24,7 +24,7 @@ if (!defined('E_DEPRECATED'))
{
define('E_DEPRECATED', 8192);
}
-error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
/*
* Remove variables created by register_globals from the global scope
@@ -69,7 +69,7 @@ function deregister_globals()
{
if (isset($not_unset[$varname]))
{
- // Hacking attempt. No point in continuing unless it's a COOKIE
+ // Hacking attempt. No point in continuing unless it's a COOKIE (so a cookie called GLOBALS doesn't lock users out completely)
if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))
{
exit;
@@ -79,6 +79,11 @@ function deregister_globals()
$cookie = &$_COOKIE;
while (isset($cookie['GLOBALS']))
{
+ if (!is_array($cookie['GLOBALS']))
+ {
+ break;
+ }
+
foreach ($cookie['GLOBALS'] as $registered_var => $value)
{
if (!isset($not_unset[$registered_var]))
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 70c8173a32..dec8f8c210 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -253,7 +253,7 @@ foreach ($schema_data as $table_name => $table_data)
// Do we now need to re-add the fulltext index? ;)
if ($table_name == ($prefix . 'posts') && $drop_index)
{
- echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text){$newline}";
+ echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text);{$newline}";
}
}
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index e1ec835b9b..ed5c4f55b8 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -35,7 +35,7 @@ if (isset($_GET['avatar']))
{
define('E_DEPRECATED', 8192);
}
- error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+ error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
require($phpbb_root_path . 'config.' . $phpEx);
diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php
index 5f24618aab..ecdad43978 100644
--- a/phpBB/includes/captcha/captcha_gd.php
+++ b/phpBB/includes/captcha/captcha_gd.php
@@ -77,7 +77,7 @@ class captcha
{
$denom = ($code_len - $i);
$denom = max(1.3, $denom);
- $offset[$i] = mt_rand(0, (1.5 * $width_avail) / $denom);
+ $offset[$i] = phpbb_mt_rand(0, (int) round((1.5 * $width_avail) / $denom));
$width_avail -= $offset[$i];
}
diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
index ea171dbe2c..0b0270f568 100644
--- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
+++ b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
@@ -27,9 +27,14 @@ if (!class_exists('phpbb_default_captcha'))
*/
class phpbb_recaptcha extends phpbb_default_captcha
{
- var $recaptcha_server = 'http://api.recaptcha.net';
- var $recaptcha_server_secure = 'https://api-secure.recaptcha.net'; // class constants :(
- var $recaptcha_verify_server = 'api-verify.recaptcha.net';
+ var $recaptcha_server = 'http://www.google.com/recaptcha/api';
+ var $recaptcha_server_secure = 'https://www.google.com/recaptcha/api'; // class constants :(
+
+ // We are opening a socket to port 80 of this host and send
+ // the POST request asking for verification to the path specified here.
+ var $recaptcha_verify_server = 'www.google.com';
+ var $recaptcha_verify_path = '/recaptcha/api/verify';
+
var $challenge;
var $response;
@@ -296,7 +301,7 @@ class phpbb_recaptcha extends phpbb_default_captcha
return $user->lang['RECAPTCHA_INCORRECT'];
}
- $response = $this->_recaptcha_http_post($this->recaptcha_verify_server, '/verify',
+ $response = $this->_recaptcha_http_post($this->recaptcha_verify_server, $this->recaptcha_verify_path,
array(
'privatekey' => $config['recaptcha_privkey'],
'remoteip' => $user->ip,
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index f4b181c6ad..483ceee043 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -681,10 +681,12 @@ class phpbb_db_tools
{
foreach ($columns as $column_name => $column_data)
{
- // Only add the column if it does not exist yet, else change it (to be consistent)
+ // Only add the column if it does not exist yet
if ($column_exists = $this->sql_column_exists($table, $column_name))
{
- $result = $this->sql_column_change($table, $column_name, $column_data, true);
+ continue;
+ // This is commented out here because it can take tremendous time on updates
+// $result = $this->sql_column_change($table, $column_name, $column_data, true);
}
else
{
@@ -695,7 +697,8 @@ class phpbb_db_tools
{
if ($column_exists)
{
- $sqlite_data[$table]['change_columns'][] = $result;
+ continue;
+// $sqlite_data[$table]['change_columns'][] = $result;
}
else
{
@@ -717,6 +720,11 @@ class phpbb_db_tools
{
foreach ($indexes as $index_name)
{
+ if (!$this->sql_index_exists($table, $index_name))
+ {
+ continue;
+ }
+
$result = $this->sql_index_drop($table, $index_name);
if ($this->return_statements)
@@ -777,6 +785,11 @@ class phpbb_db_tools
{
foreach ($index_array as $index_name => $column)
{
+ if ($this->sql_unique_index_exists($table, $index_name))
+ {
+ continue;
+ }
+
$result = $this->sql_create_unique_index($table, $index_name, $column);
if ($this->return_statements)
@@ -794,6 +807,11 @@ class phpbb_db_tools
{
foreach ($index_array as $index_name => $column)
{
+ if ($this->sql_index_exists($table, $index_name))
+ {
+ continue;
+ }
+
$result = $this->sql_create_index($table, $index_name, $column);
if ($this->return_statements)
@@ -1103,6 +1121,236 @@ class phpbb_db_tools
}
/**
+ * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
+ *
+ * @param string $table_name Table to check the index at
+ * @param string $index_name The index name to check
+ *
+ * @return bool True if index exists, else false
+ */
+ function sql_index_exists($table_name, $index_name)
+ {
+ if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['TYPE'] == 3)
+ {
+ if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'firebird':
+ $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
+ FROM RDB\$INDICES
+ WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
+ AND RDB\$UNIQUE_FLAG IS NULL
+ AND RDB\$FOREIGN_KEY IS NULL";
+ $col = 'index_name';
+ break;
+
+ case 'postgres':
+ $sql = "SELECT ic.relname as index_name
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisunique != 't')
+ AND (i.indisprimary != 't')";
+ $col = 'index_name';
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = 'SHOW KEYS
+ FROM ' . $table_name;
+ $col = 'Key_name';
+ break;
+
+ case 'oracle':
+ $sql = "SELECT index_name
+ FROM user_indexes
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND generated = 'N'
+ AND uniqueness = 'NONUNIQUE'";
+ $col = 'index_name';
+ break;
+
+ case 'sqlite':
+ $sql = "PRAGMA index_list('" . $table_name . "');";
+ $col = 'name';
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
+ {
+ continue;
+ }
+
+ // These DBMS prefix index name with the table name
+ switch ($this->sql_layer)
+ {
+ case 'firebird':
+ case 'oracle':
+ case 'postgres':
+ case 'sqlite':
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ break;
+ }
+
+ if (strtolower($row[$col]) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
+ *
+ * @param string $table_name Table to check the index at
+ * @param string $index_name The index name to check
+ *
+ * @return bool True if index exists, else false
+ */
+ function sql_unique_index_exists($table_name, $index_name)
+ {
+ if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Usually NON_UNIQUE is the column we want to check, but we allow for both
+ if ($row['TYPE'] == 3)
+ {
+ if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+ return false;
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'firebird':
+ $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
+ FROM RDB\$INDICES
+ WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
+ AND RDB\$UNIQUE_FLAG IS NOT NULL
+ AND RDB\$FOREIGN_KEY IS NULL";
+ $col = 'index_name';
+ break;
+
+ case 'postgres':
+ $sql = "SELECT ic.relname as index_name, i.indisunique
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisprimary != 't')";
+ $col = 'index_name';
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = 'SHOW KEYS
+ FROM ' . $table_name;
+ $col = 'Key_name';
+ break;
+
+ case 'oracle':
+ $sql = "SELECT index_name, table_owner
+ FROM user_indexes
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND generated = 'N'
+ AND uniqueness = 'UNIQUE'";
+ $col = 'index_name';
+ break;
+
+ case 'sqlite':
+ $sql = "PRAGMA index_list('" . $table_name . "');";
+ $col = 'name';
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && ($row['Non_unique'] || $row[$col] == 'PRIMARY'))
+ {
+ continue;
+ }
+
+ if ($this->sql_layer == 'sqlite' && !$row['unique'])
+ {
+ continue;
+ }
+
+ if ($this->sql_layer == 'postgres' && $row['indisunique'] != 't')
+ {
+ continue;
+ }
+
+ // These DBMS prefix index name with the table name
+ switch ($this->sql_layer)
+ {
+ case 'oracle':
+ // Two cases here... prefixed with U_[table_owner] and not prefixed with table_name
+ if (strpos($row[$col], 'U_') === 0)
+ {
+ $row[$col] = substr($row[$col], strlen('U_' . $row['table_owner']) + 1);
+ }
+ else if (strpos($row[$col], strtoupper($table_name)) === 0)
+ {
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ }
+ break;
+
+ case 'firebird':
+ case 'postgres':
+ case 'sqlite':
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ break;
+ }
+
+ if (strtolower($row[$col]) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
* Private method for performing sql statements (either execute them or return them)
* @access private
*/
@@ -1371,24 +1619,29 @@ class phpbb_db_tools
switch ($this->sql_layer)
{
case 'firebird':
+ // Does not support AFTER statement, only POSITION (and there you need the column position)
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD "' . strtoupper($column_name) . '" ' . $column_data['column_type_sql'];
break;
case 'mssql':
case 'mssqlnative':
+ // Does not support AFTER, only through temporary table
$statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
break;
case 'mysql_40':
case 'mysql_41':
- $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'];
+ $after = (!empty($column_data['after'])) ? ' AFTER ' . $column_data['after'] : '';
+ $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'] . $after;
break;
case 'oracle':
+ // Does not support AFTER, only through temporary table
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
break;
case 'postgres':
+ // Does not support AFTER, only through temporary table
if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
@@ -1957,6 +2210,7 @@ class phpbb_db_tools
}
else
{
+ // TODO: try to change pkey without removing trigger, generator or constraints. ATM this query may fail.
$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
}
break;
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index d7860fc8bc..2f9619c8ea 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -246,7 +246,7 @@ class dbal
*
* @return bool Whether buffering is required.
*/
- function sql_buffer_nested_transaction()
+ function sql_buffer_nested_transactions()
{
return false;
}
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index e057e7fe74..6810562d17 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -261,7 +261,7 @@ class dbal_mssqlnative extends dbal
/**
* {@inheritDoc}
*/
- function sql_buffer_nested_transaction()
+ function sql_buffer_nested_transactions()
{
return true;
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index b8ea80ad4a..c48eb6d102 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -175,7 +175,8 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
switch ($db->sql_layer)
{
case 'firebird':
- $sql_update = 'CAST(CAST(config_value as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
+ // Precision must be from 1 to 18
+ $sql_update = 'CAST(CAST(config_value as DECIMAL(18, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
break;
case 'postgres':
@@ -249,6 +250,22 @@ function unique_id($extra = 'c')
}
/**
+* Wrapper for mt_rand() which allows swapping $min and $max parameters.
+*
+* PHP does not allow us to swap the order of the arguments for mt_rand() anymore.
+* (since PHP 5.3.4, see http://bugs.php.net/46587)
+*
+* @param int $min Lowest value to be returned
+* @param int $max Highest value to be returned
+*
+* @return int Random integer between $min and $max (or $max and $min)
+*/
+function phpbb_mt_rand($min, $max)
+{
+ return ($min > $max) ? mt_rand($max, $min) : mt_rand($min, $max);
+}
+
+/**
* Return formatted string for filesizes
*
* @param int $value filesize in bytes
@@ -3742,7 +3759,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false)
{
// flush the content, else we get a white page if output buffering is on
- if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on')
+ if (ob_get_level() > 0)
{
@ob_flush();
}
@@ -4528,7 +4545,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template',
'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template',
'T_IMAGESET_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset',
- 'T_IMAGESET_LANG_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
+ 'T_IMAGESET_LANG_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->lang_name,
'T_IMAGES_PATH' => "{$web_path}images/",
'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/",
'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/",
@@ -4536,7 +4553,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
- 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang']),
+ 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->lang_name),
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
'T_THEME_NAME' => $user->theme['theme_path'],
@@ -4718,7 +4735,7 @@ function exit_handler()
}
// As a pre-caution... some setups display a blank page if the flush() is not there.
- (empty($config['gzip_compress'])) ? @flush() : @ob_flush();
+ (ob_get_level() > 0) ? @ob_flush() : @flush();
exit;
}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index acaef49fe8..d7422aa2c9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -477,7 +477,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'SUBFORUMS' => $s_subforums_list,
'L_SUBFORUM_STR' => $l_subforums,
- 'L_FORUM_FOLDER_ALT' => $folder_alt,
'L_MODERATOR_STR' => $l_moderator,
'U_UNAPPROVED_TOPICS' => ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=unapproved_topics&amp;f=' . $row['forum_id_unapproved_topics']) : '',
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index d803f8d799..2181375dc1 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1238,6 +1238,12 @@ class session
$ip = $this->ip;
}
+ // Neither Spamhaus nor Spamcop supports IPv6 addresses.
+ if (strpos($ip, ':') !== false)
+ {
+ return false;
+ }
+
$dnsbl_check = array(
'sbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=',
);
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 8debaabf31..b00c1b9f52 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -98,6 +98,13 @@ class ucp_activate
SET user_actkey = ''
WHERE user_id = {$user_row['user_id']}";
$db->sql_query($sql);
+
+ // Create the correct logs
+ add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER');
+ if ($auth->acl_get('a_user'))
+ {
+ add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']);
+ }
}
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index e1c51170db..c675928a5b 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -115,7 +115,7 @@ class ucp_pm
case 'compose':
$action = request_var('action', 'post');
- get_folder($user->data['user_id']);
+ $user_folders = get_folder($user->data['user_id']);
if (!$auth->acl_get('u_sendpm'))
{
@@ -130,7 +130,7 @@ class ucp_pm
}
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
- compose_pm($id, $mode, $action);
+ compose_pm($id, $mode, $action, $user_folders);
$tpl_file = 'posting_body';
break;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index b596e72c41..05243e3d7a 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
* Compose private message
* Called from ucp_pm with mode == 'compose'
*/
-function compose_pm($id, $mode, $action)
+function compose_pm($id, $mode, $action, $user_folders = array())
{
global $template, $db, $auth, $user;
global $phpbb_root_path, $phpEx, $config;
@@ -135,6 +135,7 @@ function compose_pm($id, $mode, $action)
}
$sql = '';
+ $folder_id = 0;
// What is all this following SQL for? Well, we need to know
// some basic information in all cases before we do anything.
@@ -398,7 +399,7 @@ function compose_pm($id, $mode, $action)
unset($message_text);
$s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=$mode&amp;action=$action", true, $user->session_id);
- $s_action .= ($msg_id) ? "&amp;p=$msg_id" : '';
+ $s_action .= (($folder_id) ? "&amp;f=$folder_id" : '') . (($msg_id) ? "&amp;p=$msg_id" : '');
// Delete triggered ?
if ($action == 'delete')
@@ -741,10 +742,30 @@ function compose_pm($id, $mode, $action)
$msg_id = submit_pm($action, $subject, $pm_data);
$return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;p=' . $msg_id);
- $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
- meta_refresh(3, $return_message_url);
+ $inbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox');
+ $outbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
+
+ $folder_url = '';
+ if (($folder_id > 0) && isset($user_folders[$folder_id]))
+ {
+ $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=' . $folder_id);
+ }
+
+ $return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url;
+ $return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
+
- $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
+ $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
+
+ $last_click_type = 'CLICK_RETURN_FOLDER';
+ if ($folder_url)
+ {
+ $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']);
+ $last_click_type = 'CLICK_GOTO_FOLDER';
+ }
+ $message .= '<br /><br />' . sprintf($user->lang[$last_click_type], '<a href="' . $return_box_url . '">', '</a>', $user->lang[$return_box_lang]);
+
+ meta_refresh(3, $return_message_url);
trigger_error($message);
}
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 78224dd5da..466f57a572 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -94,6 +94,7 @@ function phpbb_insert_forums()
{
case 'mssql':
case 'mssql_odbc':
+ case 'mssqlnative':
$db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' ON');
break;
}
@@ -291,6 +292,7 @@ function phpbb_insert_forums()
case 'mssql':
case 'mssql_odbc':
+ case 'mssqlnative':
$db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF');
break;
@@ -1727,6 +1729,7 @@ function phpbb_create_userconv_table()
case 'mssql':
case 'mssql_odbc':
+ case 'mssqlnative':
$map_dbms = 'mssql';
break;
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 01048520d2..3d32a82cc6 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -35,7 +35,7 @@ if (!defined('E_DEPRECATED'))
{
define('E_DEPRECATED', 8192);
}
-//error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+//error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
error_reporting(E_ALL);
@set_time_limit(0);
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 49c99da0d7..bace22f177 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -23,7 +23,7 @@ if (!defined('E_DEPRECATED'))
{
define('E_DEPRECATED', 8192);
}
-error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
// @todo Review this test and see if we can find out what it is which prevents PHP 4.2.x from even displaying the page with requirements on it
if (version_compare(PHP_VERSION, '4.3.3') < 0)
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index ade523a7f3..ea4157d6a3 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -565,7 +565,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
# No Avatar (u_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_chgavatar', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group');
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar', 'u_masspm', 'u_masspm_group');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar');
# Full Moderator (m_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%';
diff --git a/phpBB/language/en/captcha_recaptcha.php b/phpBB/language/en/captcha_recaptcha.php
index 463bfffe0d..9b2fb2049d 100644
--- a/phpBB/language/en/captcha_recaptcha.php
+++ b/phpBB/language/en/captcha_recaptcha.php
@@ -37,14 +37,14 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'RECAPTCHA_LANG' => 'en',
- 'RECAPTCHA_NOT_AVAILABLE' => 'In order to use reCaptcha, you must create an account on <a href="http://recaptcha.net">reCaptcha.net</a>.',
+ 'RECAPTCHA_NOT_AVAILABLE' => 'In order to use reCaptcha, you must create an account on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.',
'CAPTCHA_RECAPTCHA' => 'reCaptcha',
'RECAPTCHA_INCORRECT' => 'The visual confirmation code you submitted was incorrect',
'RECAPTCHA_PUBLIC' => 'Public reCaptcha key',
- 'RECAPTCHA_PUBLIC_EXPLAIN' => 'Your public reCaptcha key. Keys can be obtained on <a href="http://recaptcha.net">reCaptcha.net</a>.',
+ 'RECAPTCHA_PUBLIC_EXPLAIN' => 'Your public reCaptcha key. Keys can be obtained on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.',
'RECAPTCHA_PRIVATE' => 'Private reCaptcha key',
- 'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://recaptcha.net">reCaptcha.net</a>.',
+ 'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.',
'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.',
));
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 731f674120..078a280223 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -329,7 +329,7 @@ $lang = array_merge($lang, array(
'MEMBERLIST' => 'Members',
'MEMBERLIST_EXPLAIN' => 'View complete list of members',
'MERGE' => 'Merge',
- 'MERGE_POSTS' => 'Merge posts',
+ 'MERGE_POSTS' => 'Move posts',
'MERGE_TOPIC' => 'Merge topic',
'MESSAGE' => 'Message',
'MESSAGES' => 'Messages',
@@ -530,6 +530,7 @@ $lang = array_merge($lang, array(
'SEARCH_TOPIC' => 'Search this topic…',
'SEARCH_UNANSWERED' => 'View unanswered posts',
'SEARCH_UNREAD' => 'View unread posts',
+ 'SEARCH_USER_POSTS' => 'Search user’s posts',
'SECONDS' => 'Seconds',
'SELECT' => 'Select',
'SELECT_ALL_CODE' => 'Select all',
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index fc1b8c8f62..d0bcec0d9c 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -209,9 +209,8 @@ $lang = array_merge($lang, array(
'MCP_WARN_POST' => 'Warn for specific post',
'MCP_WARN_USER' => 'Warn user',
- 'MERGE_POSTS' => 'Merge posts',
- 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to merge the selected posts?',
- 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic.<br />Please enter the destination topic id or click on “Select topic” to search for one.',
+ 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to move the selected posts?',
+ 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can move selected posts into another topic. The posts will be split from this topic and merged into the other topic. These posts will not be reordered and will appear as if the users posted them to the new topic.<br />Please enter the destination topic id or click on “Select topic” to search for one.',
'MERGE_TOPIC_ID' => 'Destination topic identification number',
'MERGE_TOPICS' => 'Merge topics',
'MERGE_TOPICS_CONFIRM' => 'Are you sure you want to merge the selected topics?',
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index 213f766610..e71f9d6565 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -116,7 +116,6 @@ $lang = array_merge($lang, array(
'REMOVE_FOE' => 'Remove foe',
'REMOVE_FRIEND' => 'Remove friend',
- 'SEARCH_USER_POSTS' => 'Search user’s posts',
'SELECT_MARKED' => 'Select marked',
'SELECT_SORT_METHOD' => 'Select sort method',
'SEND_AIM_MESSAGE' => 'Send AIM message',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 02b8a282d9..ad7c1ccbff 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -119,6 +119,7 @@ $lang = array_merge($lang, array(
'CANNOT_REMOVE_FOLDER' => 'This folder cannot be removed.',
'CHANGE_DEFAULT_GROUP' => 'Change default group',
'CHANGE_PASSWORD' => 'Change password',
+ 'CLICK_GOTO_FOLDER' => '%1$sGo to your “%3$s” folder%2$s',
'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s” folder%2$s',
'CONFIRMATION' => 'Confirmation of registration',
'CONFIRM_CHANGES' => 'Confirm changes',
diff --git a/phpBB/style.php b/phpBB/style.php
index 8ca1751391..f3e1b4c89e 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -20,7 +20,7 @@ if (!defined('E_DEPRECATED'))
{
define('E_DEPRECATED', 8192);
}
-error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
require($phpbb_root_path . 'config.' . $phpEx);
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index db36ebf5ac..a4d2a0f600 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -31,7 +31,7 @@ onload_functions.push('subPanels()');
</li>
<li id="merge-panel-tab"<!-- IF S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->>
<span class="corners-top"><span></span></span>
- <a href="#minitabs" onclick="subPanels('merge-panel'); return false;"><span>{L_MERGE_TOPIC}</span></a>
+ <a href="#minitabs" onclick="subPanels('merge-panel'); return false;"><span>{L_MERGE_POSTS}</span></a>
</li>
</ul>
</div>
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index 12c0f73b97..13865d26ee 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -35,7 +35,7 @@
<!-- IF S_CAN_MERGE -->
<tr>
- <th colspan="3" nowrap="nowrap">{L_MERGE_TOPIC}</th>
+ <th colspan="3" nowrap="nowrap">{L_MERGE_POSTS}</th>
</tr>
<tr>
<td class="row2" colspan="3" align="center"><span class="gensmall">{L_MERGE_TOPIC_EXPLAIN}</span></td>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index bba00ce685..630871af61 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -150,7 +150,7 @@
<!-- IF postrow.POST_ICON_IMG -->
<td><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" title="" /></td>
<!-- ENDIF -->
- <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}:</b> {postrow.POST_SUBJECT}</div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE}&nbsp;</div></td>
+ <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}:</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE}&nbsp;</div></td>
</tr>
</table>
</td>
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index f5a2ec9648..8fa022668b 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -314,6 +314,12 @@ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
$module->set_display('main', 'subscribed', false);
}
+// Do not display signature panel if not authed to do so
+if (!$auth->acl_get('u_sig'))
+{
+ $module->set_display('profile', 'signature', false);
+}
+
// Select the active module
$module->set_active($id, $mode);