aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/acp_ban.html6
-rw-r--r--phpBB/docs/coding-guidelines.html2
-rw-r--r--phpBB/docs/nginx.conf.sample70
-rw-r--r--phpBB/includes/acp/acp_ban.php4
-rw-r--r--phpBB/includes/acp/acp_board.php2
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_users.php7
-rw-r--r--phpBB/includes/acp/info/acp_board.php2
-rw-r--r--phpBB/includes/db/firebird.php11
-rw-r--r--phpBB/includes/db/mssql.php7
-rw-r--r--phpBB/includes/db/mssql_odbc.php7
-rw-r--r--phpBB/includes/db/mssqlnative.php7
-rw-r--r--phpBB/includes/db/mysql.php7
-rw-r--r--phpBB/includes/db/mysqli.php8
-rw-r--r--phpBB/includes/db/oracle.php10
-rw-r--r--phpBB/includes/db/postgres.php7
-rw-r--r--phpBB/includes/db/sqlite.php11
-rw-r--r--phpBB/includes/functions.php6
-rw-r--r--phpBB/includes/functions_admin.php8
-rw-r--r--phpBB/includes/functions_convert.php3
-rw-r--r--phpBB/includes/functions_display.php6
-rw-r--r--phpBB/includes/functions_user.php16
-rw-r--r--phpBB/includes/mcp/mcp_post.php2
-rw-r--r--phpBB/includes/mcp/mcp_queue.php2
-rw-r--r--phpBB/includes/mcp/mcp_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_topic.php2
-rw-r--r--phpBB/includes/session.php4
-rw-r--r--phpBB/includes/ucp/ucp_main.php4
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
-rw-r--r--phpBB/index.php8
-rw-r--r--phpBB/install/database_update.php66
-rw-r--r--phpBB/install/install_convert.php2
-rw-r--r--phpBB/install/install_install.php1
-rw-r--r--phpBB/install/install_update.php11
-rw-r--r--phpBB/language/en/acp/board.php3
-rw-r--r--phpBB/language/en/acp/styles.php44
-rw-r--r--phpBB/language/en/acp/users.php1
-rw-r--r--phpBB/language/en/common.php9
-rw-r--r--phpBB/language/en/viewforum.php13
-rw-r--r--phpBB/style.php21
-rw-r--r--phpBB/styles/prosilver/template/editor.js6
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html2
-rw-r--r--phpBB/styles/subsilver2/template/attachment.html4
-rw-r--r--phpBB/styles/subsilver2/template/editor.js6
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html6
-rw-r--r--phpBB/styles/subsilver2/template/posting_buttons.html1
-rw-r--r--phpBB/styles/subsilver2/template/posting_topic_review.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_history.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html18
-rw-r--r--phpBB/viewforum.php17
-rw-r--r--phpBB/viewtopic.php2
-rw-r--r--tests/RUNNING_TESTS.txt33
-rw-r--r--tests/regex/email.php43
-rw-r--r--tests/template/template.php24
55 files changed, 442 insertions, 132 deletions
diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html
index 539e8032dd..cf44f4aaa7 100644
--- a/phpBB/adm/style/acp_ban.html
+++ b/phpBB/adm/style/acp_ban.html
@@ -31,9 +31,9 @@
function display_details(option)
{
- document.getElementById('acp_unban').unbangivereason.value = ban_give_reason[option];
- document.getElementById('acp_unban').unbanreason.value = ban_reason[option];
- document.getElementById('acp_unban').unbanlength.value = ban_length[option];
+ document.getElementById('acp_unban').unbangivereason.innerHTML = ban_give_reason[option];
+ document.getElementById('acp_unban').unbanreason.innerHTML = ban_reason[option];
+ document.getElementById('acp_unban').unbanlength.innerHTML = ban_length[option];
}
// ]]>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 7f747e09e2..1978a0a307 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -288,7 +288,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<div class="content">
- <p>Please note that these Guidelines applies to all php, html, javascript and css files.</p>
+ <p>Please note that these guidelines apply to all php, html, javascript and css files.</p>
<a name="namingvars"></a><h3>2.i. Variable/Function Naming</h3>
diff --git a/phpBB/docs/nginx.conf.sample b/phpBB/docs/nginx.conf.sample
new file mode 100644
index 0000000000..a22a126ff4
--- /dev/null
+++ b/phpBB/docs/nginx.conf.sample
@@ -0,0 +1,70 @@
+# Sample nginx configuration file for phpBB.
+# Global settings have been removed, copy them
+# from your system's nginx.conf.
+# Tested with nginx 0.8.35.
+
+http {
+ # Compression - requires gzip and gzip static modules.
+ gzip on;
+ gzip_static on;
+ gzip_vary on;
+ gzip_http_version 1.1;
+ gzip_min_length 700;
+ gzip_comp_level 6;
+ gzip_disable "MSIE [1-6]\.";
+
+ # Catch-all server for requests to invalid hosts.
+ # Also catches vulnerability scanners probing IP addresses.
+ # Should be first.
+ server {
+ listen 80;
+ server_name bogus;
+ return 444;
+ root /var/empty;
+ }
+
+ # If you have domains with and without www prefix,
+ # redirect one to the other.
+ server {
+ listen 80;
+ server_name myforums.com;
+ rewrite ^(.*)$ http://www.myforums.com$1 permanent;
+ }
+
+ # The actual board domain.
+ server {
+ listen 80;
+ server_name www.myforums.com;
+
+ root /path/to/phpbb;
+
+ location / {
+ # phpbb uses index.htm
+ index index.php index.html index.htm;
+ }
+
+ # Deny access to internal phpbb files.
+ location ~ /(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) {
+ deny all;
+ }
+
+ # Pass the php scripts to fastcgi server specified in upstream declaration.
+ location ~ \.php$ {
+ fastcgi_pass php;
+ # Necessary for php.
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ # Unmodified fastcgi_params from nginx distribution.
+ include fastcgi_params;
+ }
+
+ # Deny access to version control system directories.
+ location ~ /\.svn|/\.git {
+ deny all;
+ }
+ }
+
+ # If running php as fastcgi, specify php upstream.
+ upstream php {
+ server unix:/tmp/php.sock;
+ }
+}
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 3198376584..a7ea57b753 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -224,7 +224,7 @@ class acp_ban
$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
- 'A_REASON' => addslashes(htmlspecialchars_decode($reason)),
+ 'A_REASON' => addslashes($reason),
));
}
}
@@ -236,7 +236,7 @@ class acp_ban
$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
- 'A_REASON' => addslashes(htmlspecialchars_decode($reason)),
+ 'A_REASON' => addslashes($reason),
));
}
}
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 7680d8996c..927e72010e 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -58,7 +58,7 @@ class acp_board
'board_disable_msg' => false,
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
- 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
+ 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 6261f866bb..f2f1bd80e2 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -983,7 +983,7 @@ class acp_forums
if (!$row)
{
- trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id), E_USER_WARNING);
+ trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
if ($row['forum_type'] == FORUM_LINK)
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 7914edd056..1f10893781 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -231,6 +231,11 @@ class acp_users
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
+ if ($user_id == ANONYMOUS)
+ {
+ trigger_error($user->lang['CANNOT_BAN_ANONYMOUS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
+
if ($user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['CANNOT_BAN_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
@@ -1706,7 +1711,7 @@ class acp_users
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
- if (avatar_process_user($error, $user_row))
+ if (avatar_process_user($error, $user_row, $can_upload))
{
trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_row['user_id']));
}
diff --git a/phpBB/includes/acp/info/acp_board.php b/phpBB/includes/acp/info/acp_board.php
index 58b650650c..3e18f55940 100644
--- a/phpBB/includes/acp/info/acp_board.php
+++ b/phpBB/includes/acp/info/acp_board.php
@@ -24,7 +24,7 @@ class acp_board_info
'features' => array('title' => 'ACP_BOARD_FEATURES', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'avatar' => array('title' => 'ACP_AVATAR_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'message' => array('title' => 'ACP_MESSAGE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
- 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
+ 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
'signature' => array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'feed' => array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'registration' => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php
index e554b0f2fb..6f60dd5dad 100644
--- a/phpBB/includes/db/firebird.php
+++ b/phpBB/includes/db/firebird.php
@@ -63,10 +63,19 @@ class dbal_firebird extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache forced to false for Interbase
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
+ /**
+ * force $use_cache false. I didn't research why the caching code there is no caching code
+ * but I assume its because the IB extension provides a direct method to access it
+ * without a query.
+ */
+
+ $use_cache = false;
+
if ($this->service_handle !== false && function_exists('ibase_server_info'))
{
return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION);
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index 7134574691..6899a73902 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -65,13 +65,14 @@ class dbal_mssql extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
{
$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
@@ -84,7 +85,7 @@ class dbal_mssql extends dbal
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mssql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 14c4831010..75a080b1b7 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -76,13 +76,14 @@ class dbal_mssql_odbc extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
{
$result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')");
@@ -95,7 +96,7 @@ class dbal_mssql_odbc extends dbal
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mssqlodbc_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 08ee70907c..98e22d4412 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -232,18 +232,19 @@ class dbal_mssqlnative extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
{
$arr_server_info = sqlsrv_server_info($this->db_connect_id);
$this->sql_server_version = $arr_server_info['SQLServerVersion'];
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mssql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 0487dfa6d2..1e24c79577 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -96,13 +96,14 @@ class dbal_mysql extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
{
$result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
$row = @mysql_fetch_assoc($result);
@@ -110,7 +111,7 @@ class dbal_mysql extends dbal
$this->sql_server_version = $row['version'];
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mysql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index f0e58fd148..862d62f4ba 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -80,14 +80,14 @@ class dbal_mysqli extends dbal
/**
* Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
{
$result = @mysqli_query($this->db_connect_id, 'SELECT VERSION() AS version');
$row = @mysqli_fetch_assoc($result);
@@ -95,7 +95,7 @@ class dbal_mysqli extends dbal
$this->sql_server_version = $row['version'];
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mysqli_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 5a9b18abf0..c8a9a5f604 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -56,10 +56,18 @@ class dbal_oracle extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache forced to false for Oracle
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
+ /**
+ * force $use_cache false. I didn't research why the caching code below is commented out
+ * but I assume its because the Oracle extension provides a direct method to access it
+ * without a query.
+ */
+
+ $use_cache = false;
/*
global $cache;
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index 2a885f1d04..4360c790a1 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -108,13 +108,14 @@ class dbal_postgres extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
{
$query_id = @pg_query($this->db_connect_id, 'SELECT VERSION() AS version');
$row = @pg_fetch_assoc($query_id, null);
@@ -122,7 +123,7 @@ class dbal_postgres extends dbal
$this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('pgsql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 288f6e0992..8de72fd394 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -50,19 +50,24 @@ class dbal_sqlite extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache if true, it is safe to retrieve the stored value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
{
$result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
$row = @sqlite_fetch_array($result, SQLITE_ASSOC);
$this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
- $cache->put('sqlite_version', $this->sql_server_version);
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('sqlite_version', $this->sql_server_version);
+ }
}
return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 3f097f171f..bc3d721de5 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3355,7 +3355,9 @@ function get_preg_expression($mode)
switch ($mode)
{
case 'email':
- return '(?:[a-z0-9\'\.\-_\+\|]++|&amp;)+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+';
+ // Regex written by James Watts and Francisco Jose Martin Moreno
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
break;
case 'bbcode_htm':
@@ -4318,7 +4320,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'], true, $user->session_id),
+ '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_NAME' => $user->theme['theme_name'],
'T_THEME_NAME' => $user->theme['theme_path'],
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 4cd2962e3b..89892feb30 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -573,8 +573,8 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
while ($row = $db->sql_fetchrow($result))
{
- $forum_ids[] = $row['forum_id'];
- $topic_ids[] = $row['topic_id'];
+ $forum_ids[] = (int) $row['forum_id'];
+ $topic_ids[] = (int) $row['topic_id'];
}
$db->sql_freeresult($result);
@@ -591,7 +591,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
}
$sql = 'UPDATE ' . POSTS_TABLE . '
- SET forum_id = ' . $forum_row['forum_id'] . ", topic_id = $topic_id
+ SET forum_id = ' . (int) $forum_row['forum_id'] . ", topic_id = $topic_id
WHERE " . $db->sql_in_set('post_id', $post_ids);
$db->sql_query($sql);
@@ -602,7 +602,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
if ($auto_sync)
{
- $forum_ids[] = $forum_row['forum_id'];
+ $forum_ids[] = (int) $forum_row['forum_id'];
sync('topic_reported', 'topic_id', $topic_ids);
sync('topic_attachment', 'topic_id', $topic_ids);
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 0fdae9b274..c035fd3739 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1025,6 +1025,9 @@ function set_user_options()
'bbcode' => array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
'popuppm' => array('bit' => 10, 'default' => 0),
+ 'sig_bbcode' => array('bit' => 15, 'default' => 1),
+ 'sig_smilies' => array('bit' => 16, 'default' => 1),
+ 'sig_links' => array('bit' => 17, 'default' => 1),
);
$option_field = 0;
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 5e6239b070..2de7e1b169 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -396,7 +396,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
else
{
- $folder_alt = ($forum_unread) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
+ $folder_alt = ($forum_unread) ? 'UNREAD_POSTS' : 'NO_UNREAD_POSTS';
}
// Create last post link information, if appropriate
@@ -425,7 +425,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$s_subforums_list = array();
foreach ($subforums_list as $subforum)
{
- $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>';
+ $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['UNREAD_POSTS'] : $user->lang['NO_UNREAD_POSTS']) . '">' . $subforum['name'] . '</a>';
}
$s_subforums_list = (string) implode(', ', $s_subforums_list);
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
@@ -854,7 +854,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
$folder_img = ($unread_topic) ? $folder_new : $folder;
- $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
+ $folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
// Posted image?
if (!empty($topic_row['topic_posted']) && $topic_row['topic_posted'])
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index f58e19ddbe..0b26f28864 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -528,7 +528,7 @@ function user_delete($mode, $user_id, $post_username = false)
$db->sql_transaction('begin');
- $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE);
+ $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);
foreach ($table_ary as $table)
{
@@ -837,14 +837,15 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('username_clean', $sql_usernames);
- // Do not allow banning yourself
+ // Do not allow banning yourself, the guest account, or founders.
+ $non_bannable = array($user->data['user_id'], ANONYMOUS);
if (sizeof($founder))
{
- $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), array($user->data['user_id'])), true);
+ $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), $non_bannable), true);
}
else
{
- $sql .= ' AND user_id <> ' . $user->data['user_id'];
+ $sql .= ' AND ' . $db->sql_in_set('user_id', $non_bannable, true);
}
$result = $db->sql_query($sql);
@@ -2284,7 +2285,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
/**
* Uploading/Changing user avatar
*/
-function avatar_process_user(&$error, $custom_userdata = false)
+function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)
{
global $config, $phpbb_root_path, $auth, $user, $db;
@@ -2323,7 +2324,10 @@ function avatar_process_user(&$error, $custom_userdata = false)
$avatar_select = basename(request_var('avatar_select', ''));
// Can we upload?
- $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ if (is_null($can_upload))
+ {
+ $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ }
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
{
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index fa44e006dd..1fbedbac4f 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -200,7 +200,7 @@ function mcp_post_details($id, $mode, $action)
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 8d9ece5205..f84a8c5f07 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -196,7 +196,7 @@ class mcp_queue
'U_VIEW_POST' => $post_url,
'U_VIEW_TOPIC' => $topic_url,
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ '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>'),
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index e19fe96963..39d9fbd4af 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -205,7 +205,7 @@ class mcp_reports
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 9779478330..76cd9beb92 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -237,7 +237,7 @@ function mcp_topic_view($id, $mode, $action)
'POST_ID' => $row['post_id'],
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'),
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'S_POST_REPORTED' => ($row['post_reported']) ? true : false,
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 0a01b4e73b..e157053e61 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -2134,9 +2134,9 @@ class user extends session
// Zone offset
$zone_offset = $this->timezone + $this->dst;
- // Show date <= 1 hour ago as 'xx min ago'
+ // Show date <= 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
// A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
- if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
+ if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
{
return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
}
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index 6ac2412ef0..a6f71669ce 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -119,7 +119,7 @@ class ucp_main
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$folder_img = ($unread_topic) ? $folder_new : $folder;
- $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
+ $folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
if ($row['topic_status'] == ITEM_LOCKED)
{
@@ -318,7 +318,7 @@ class ucp_main
else
{
$folder_image = ($unread_forum) ? 'forum_unread' : 'forum_read';
- $folder_alt = ($unread_forum) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
+ $folder_alt = ($unread_forum) ? 'UNREAD_POSTS' : 'NO_UNREAD_POSTS';
}
// Create last post link information, if appropriate
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index f4f4abad4a..363a4803b6 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -572,7 +572,7 @@ class ucp_profile
{
if (check_form_key('ucp_avatar'))
{
- if (avatar_process_user($error))
+ if (avatar_process_user($error, false, $can_upload))
{
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
diff --git a/phpBB/index.php b/phpBB/index.php
index c3dbbd346e..cc83641acd 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -115,10 +115,10 @@ $template->assign_vars(array(
'LEGEND' => $legend,
'BIRTHDAY_LIST' => $birthday_list,
- 'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'),
- 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
- 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
- 'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
+ 'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'),
+ 'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'),
+ 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_UNREAD_POSTS_LOCKED'),
+ 'FORUM_UNREAD_LOCKED_IMG' => $user->img('forum_unread_locked', 'UNREAD_POSTS_LOCKED'),
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 47d261dc46..83bbbf4577 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -685,7 +685,6 @@ function _add_modules($modules_to_install)
WHERE module_class = '" . $db->sql_escape($module_data['class']) . "'
AND parent_id = {$parent_id}
AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']}
- GROUP BY left_id
ORDER BY left_id";
$result = $db->sql_query($sql);
$steps = (int) $db->sql_fetchfield('num_modules');
@@ -1684,6 +1683,71 @@ function change_database_data(&$no_updates, $version)
}
$db->sql_freeresult($result);
+ // Install modules
+ $modules_to_install = array(
+ 'post' => array(
+ 'base' => 'board',
+ 'class' => 'acp',
+ 'title' => 'ACP_POST_SETTINGS',
+ 'auth' => 'acl_a_board',
+ 'cat' => 'ACP_MESSAGES',
+ 'after' => array('message', 'ACP_MESSAGE_SETTINGS')
+ ),
+ );
+
+ _add_modules($modules_to_install);
+
+ // add Bing Bot
+ $sql = 'SELECT group_id, group_colour
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'BOTS'";
+ $result = $db->sql_query($sql);
+ $group_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$group_row)
+ {
+ // default fallback, should never get here
+ $group_row['group_id'] = 6;
+ $group_row['group_colour'] = '9E8DA7';
+ }
+
+ if (!function_exists('user_add'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ $bot_name = 'Bing [Bot]';
+ $bot_agent = 'bingbot/';
+ $bot_ip = '';
+
+ $user_row = array(
+ 'user_type' => USER_IGNORE,
+ 'group_id' => $group_row['group_id'],
+ 'username' => $bot_name,
+ 'user_regdate' => time(),
+ 'user_password' => '',
+ 'user_colour' => $group_row['group_colour'],
+ 'user_email' => '',
+ 'user_lang' => $config['default_lang'],
+ 'user_style' => $config['default_style'],
+ 'user_timezone' => 0,
+ 'user_dateformat' => $config['default_dateformat'],
+ 'user_allow_massemail' => 0,
+ );
+
+ $user_id = user_add($user_row);
+
+ $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'bot_active' => 1,
+ 'bot_name' => (string) $bot_name,
+ 'user_id' => (int) $user_id,
+ 'bot_agent' => (string) $bot_agent,
+ 'bot_ip' => (string) $bot_ip,
+ ));
+
+ _sql($sql, $errored, $error_ary);
+ // end Bing Bot addition
$no_updates = false;
break;
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 06c3a8b4a6..8c3ffd61a8 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -685,7 +685,7 @@ class install_convert extends module
// Thanks MySQL, for silently converting...
case 'mysql':
case 'mysql4':
- if (version_compare($src_db->sql_server_info(true), '4.1.3', '>='))
+ if (version_compare($src_db->sql_server_info(true, false), '4.1.3', '>='))
{
$convert->mysql_convert = true;
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index f4989b5bd7..4c22db07b2 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -2108,6 +2108,7 @@ class install_install extends module
'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'Baidu [Spider]' => array('Baiduspider+(', ''),
+ 'Bing [Bot]' => array('bingbot/', ''),
'Exabot [Bot]' => array('Exabot/', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index e717fe3dd4..6184cbbc33 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -192,6 +192,17 @@ class install_update extends module
return;
}
+ // Check if the update files are actually meant to update from the current version
+ if ($config['version'] != $this->update_info['version']['from'])
+ {
+ $this->unequal_version = true;
+
+ $template->assign_vars(array(
+ 'S_ERROR' => true,
+ 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $config['version'], $this->update_info['version']['from'], $this->update_info['version']['to']),
+ ));
+ }
+
// Check if the update files stored are for the latest version...
if ($this->latest_version != $this->update_info['version']['to'])
{
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 52389d85b9..80db81653d 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -50,7 +50,8 @@ $lang = array_merge($lang, array(
'SITE_DESC' => 'Site description',
'SITE_NAME' => 'Site name',
'SYSTEM_DST' => 'Enable Summer Time/<abbr title="Daylight Saving Time">DST</abbr>',
- 'SYSTEM_TIMEZONE' => 'System timezone',
+ 'SYSTEM_TIMEZONE' => 'Guest timezone',
+ 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in user control panel.',
'WARNINGS_EXPIRE' => 'Warning duration',
'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a user’s record.',
));
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index 247d8a4140..951c69f915 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -165,11 +165,11 @@ $lang = array_merge($lang, array(
'IMG_FORUM_READ' => 'Forum',
'IMG_FORUM_READ_LOCKED' => 'Forum locked',
'IMG_FORUM_READ_SUBFORUM' => 'Subforum',
- 'IMG_FORUM_UNREAD' => 'Forum new posts',
- 'IMG_FORUM_UNREAD_LOCKED' => 'Forum new posts locked',
- 'IMG_FORUM_UNREAD_SUBFORUM' => 'Subforum new posts',
+ 'IMG_FORUM_UNREAD' => 'Forum unread posts',
+ 'IMG_FORUM_UNREAD_LOCKED' => 'Forum unread posts locked',
+ 'IMG_FORUM_UNREAD_SUBFORUM' => 'Subforum unread posts',
'IMG_SUBFORUM_READ' => 'Legend subforum',
- 'IMG_SUBFORUM_UNREAD' => 'Legend subforum new posts',
+ 'IMG_SUBFORUM_UNREAD' => 'Legend subforum unread posts',
'IMG_TOPIC_MOVED' => 'Topic moved',
@@ -180,39 +180,39 @@ $lang = array_merge($lang, array(
'IMG_TOPIC_READ_LOCKED' => 'Topic locked',
'IMG_TOPIC_READ_LOCKED_MINE' => 'Topic locked posted to',
- 'IMG_TOPIC_UNREAD' => 'Topic new posts',
- 'IMG_TOPIC_UNREAD_MINE' => 'Topic posted to new',
- 'IMG_TOPIC_UNREAD_HOT' => 'Topic popular new posts',
- 'IMG_TOPIC_UNREAD_HOT_MINE' => 'Topic popular posted to new',
- 'IMG_TOPIC_UNREAD_LOCKED' => 'Topic locked new',
- 'IMG_TOPIC_UNREAD_LOCKED_MINE' => 'Topic locked posted to new',
+ 'IMG_TOPIC_UNREAD' => 'Topic unread posts',
+ 'IMG_TOPIC_UNREAD_MINE' => 'Topic posted to unread',
+ 'IMG_TOPIC_UNREAD_HOT' => 'Topic popular unread posts',
+ 'IMG_TOPIC_UNREAD_HOT_MINE' => 'Topic popular posted to unread',
+ 'IMG_TOPIC_UNREAD_LOCKED' => 'Topic locked unread',
+ 'IMG_TOPIC_UNREAD_LOCKED_MINE' => 'Topic locked posted to unread',
'IMG_STICKY_READ' => 'Sticky topic',
'IMG_STICKY_READ_MINE' => 'Sticky topic posted to',
'IMG_STICKY_READ_LOCKED' => 'Sticky topic locked',
'IMG_STICKY_READ_LOCKED_MINE' => 'Sticky topic locked posted to',
- 'IMG_STICKY_UNREAD' => 'Sticky topic new posts',
- 'IMG_STICKY_UNREAD_MINE' => 'Sticky topic posted to new',
- 'IMG_STICKY_UNREAD_LOCKED' => 'Sticky topic locked new posts',
- 'IMG_STICKY_UNREAD_LOCKED_MINE' => 'Sticky topic locked posted to new',
+ 'IMG_STICKY_UNREAD' => 'Sticky topic unread posts',
+ 'IMG_STICKY_UNREAD_MINE' => 'Sticky topic posted to unread',
+ 'IMG_STICKY_UNREAD_LOCKED' => 'Sticky topic locked unread posts',
+ 'IMG_STICKY_UNREAD_LOCKED_MINE' => 'Sticky topic locked posted to unread',
'IMG_ANNOUNCE_READ' => 'Announcement',
'IMG_ANNOUNCE_READ_MINE' => 'Announcement posted to',
'IMG_ANNOUNCE_READ_LOCKED' => 'Announcement locked',
'IMG_ANNOUNCE_READ_LOCKED_MINE' => 'Announcement locked posted to',
- 'IMG_ANNOUNCE_UNREAD' => 'Announcement new posts',
- 'IMG_ANNOUNCE_UNREAD_MINE' => 'Announcement posted to new',
- 'IMG_ANNOUNCE_UNREAD_LOCKED' => 'Announcement locked new posts',
- 'IMG_ANNOUNCE_UNREAD_LOCKED_MINE' => 'Announcement locked posted to new',
+ 'IMG_ANNOUNCE_UNREAD' => 'Announcement unread posts',
+ 'IMG_ANNOUNCE_UNREAD_MINE' => 'Announcement posted to unread',
+ 'IMG_ANNOUNCE_UNREAD_LOCKED' => 'Announcement locked unread posts',
+ 'IMG_ANNOUNCE_UNREAD_LOCKED_MINE' => 'Announcement locked posted to unread',
'IMG_GLOBAL_READ' => 'Global',
'IMG_GLOBAL_READ_MINE' => 'Global posted to',
'IMG_GLOBAL_READ_LOCKED' => 'Global locked',
'IMG_GLOBAL_READ_LOCKED_MINE' => 'Global locked posted to',
- 'IMG_GLOBAL_UNREAD' => 'Global new posts',
- 'IMG_GLOBAL_UNREAD_MINE' => 'Global posted to new',
- 'IMG_GLOBAL_UNREAD_LOCKED' => 'Global locked new posts',
- 'IMG_GLOBAL_UNREAD_LOCKED_MINE' => 'Global locked posted to new',
+ 'IMG_GLOBAL_UNREAD' => 'Global unread posts',
+ 'IMG_GLOBAL_UNREAD_MINE' => 'Global posted to unread',
+ 'IMG_GLOBAL_UNREAD_LOCKED' => 'Global locked unread posts',
+ 'IMG_GLOBAL_UNREAD_LOCKED_MINE' => 'Global locked posted to unread',
'IMG_PM_READ' => 'Read private message',
'IMG_PM_UNREAD' => 'Unread private message',
diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php
index 8d9bf0d486..eda9659795 100644
--- a/phpBB/language/en/acp/users.php
+++ b/phpBB/language/en/acp/users.php
@@ -42,6 +42,7 @@ $lang = array_merge($lang, array(
'BAN_ALREADY_ENTERED' => 'The ban had been previously entered successfully. The ban list has not been updated.',
'BAN_SUCCESSFUL' => 'Ban entered successfully.',
+ 'CANNOT_BAN_ANONYMOUS' => 'You are not allowed to ban the anonymous account. Permissions for anonymous users can be set under the Permissions tab.',
'CANNOT_BAN_FOUNDER' => 'You are not allowed to ban founder accounts.',
'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.',
'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot within the bots page instead.',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 03986c0361..bc38c1563d 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -347,8 +347,8 @@ $lang = array_merge($lang, array(
'NEW_MESSAGES' => 'New messages',
'NEW_PM' => '<strong>%d</strong> new message',
'NEW_PMS' => '<strong>%d</strong> new messages',
- 'NEW_POST' => 'New post',
- 'NEW_POSTS' => 'New posts',
+ 'NEW_POST' => 'New post', // Not used anymore
+ 'NEW_POSTS' => 'New posts', // Not used anymore
'NEXT' => 'Next', // Used in pagination
'NEXT_STEP' => 'Next',
'NEVER' => 'Never',
@@ -381,7 +381,7 @@ $lang = array_merge($lang, array(
'NO_MODERATORS' => 'There are no moderators.',
'NO_NEW_MESSAGES' => 'No new messages',
'NO_NEW_PM' => '<strong>0</strong> new messages',
- 'NO_NEW_POSTS' => 'No new posts',
+ 'NO_NEW_POSTS' => 'No new posts', // Not used anymore
'NO_ONLINE_USERS' => 'No registered users',
'NO_POSTS' => 'No posts',
'NO_POSTS_TIME_FRAME' => 'No posts exist inside this topic for the selected time frame.',
@@ -395,6 +395,7 @@ $lang = array_merge($lang, array(
'NO_TOPICS' => 'There are no topics or posts in this forum.',
'NO_TOPICS_TIME_FRAME' => 'No topics exist inside this forum for the selected time frame.',
'NO_UNREAD_PM' => '<strong>0</strong> unread messages',
+ 'NO_UNREAD_POSTS' => 'No unread posts',
'NO_UPLOAD_FORM_FOUND' => 'Upload initiated but no valid file upload form found.',
'NO_USER' => 'The requested user does not exist.',
'NO_USERS' => 'The requested users do not exist.',
@@ -641,6 +642,8 @@ $lang = array_merge($lang, array(
'UNREAD_MESSAGES' => 'Unread messages',
'UNREAD_PM' => '<strong>%d</strong> unread message',
'UNREAD_PMS' => '<strong>%d</strong> unread messages',
+ 'UNREAD_POST' => 'Unread post',
+ 'UNREAD_POSTS' => 'Unread posts',
'UNWATCHED_FORUMS' => 'You are no longer subscribed to the selected forums.',
'UNWATCHED_TOPICS' => 'You are no longer subscribed to the selected topics.',
'UNWATCHED_FORUMS_TOPICS' => 'You are no longer subscribed to the selected entries.',
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index 546f91587d..d2fae20c62 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -48,16 +48,21 @@ $lang = array_merge($lang, array(
'MARK_TOPICS_READ' => 'Mark topics read',
- 'NEW_POSTS_HOT' => 'New posts [ Popular ]',
- 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]',
- 'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]',
- 'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]',
+ 'NEW_POSTS_HOT' => 'New posts [ Popular ]', // Not used anymore
+ 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]', // Not used anymore
+ 'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]', // Not used anymore
+ 'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]', // Not used anymore
'NO_READ_ACCESS' => 'You do not have the required permissions to read topics within this forum.',
+ 'NO_UNREAD_POSTS_HOT' => 'No unread posts [ Popular ]',
+ 'NO_UNREAD_POSTS_LOCKED' => 'No unread posts [ Locked ]',
'POST_FORUM_LOCKED' => 'Forum is locked',
'TOPICS_MARKED' => 'The topics for this forum have now been marked read.',
+ 'UNREAD_POSTS_HOT' => 'Unread posts [ Popular ]',
+ 'UNREAD_POSTS_LOCKED' => 'Unread posts [ Locked ]',
+
'VIEW_FORUM' => 'View forum',
'VIEW_FORUM_TOPIC' => '1 topic',
'VIEW_FORUM_TOPICS' => '%d topics',
diff --git a/phpBB/style.php b/phpBB/style.php
index fa77815670..8ca1751391 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -45,15 +45,8 @@ if (!empty($load_extensions) && function_exists('dl'))
}
}
-
-$sid = (isset($_GET['sid']) && !is_array($_GET['sid'])) ? htmlspecialchars($_GET['sid']) : '';
$id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
-if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
-{
- $sid = '';
-}
-
// This is a simple script to grab and output the requested CSS data stored in the DB
// We include a session_id check to try and limit 3rd party linking ... unless they
// happen to have a current session it will output nothing. We will also cache the
@@ -81,6 +74,20 @@ if ($id)
$config = $cache->obtain_config();
$user = false;
+ // try to get a session ID from REQUEST array
+ $sid = request_var('sid', '');
+
+ if (!$sid)
+ {
+ // if that failed, then look in the cookies
+ $sid = request_var($config['cookie_name'] . '_sid', '', false, true);
+ }
+
+ if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
+ {
+ $sid = '';
+ }
+
if ($sid)
{
$sql = 'SELECT u.user_id, u.user_lang
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js
index c4c3483766..ddc862bb8c 100644
--- a/phpBB/styles/prosilver/template/editor.js
+++ b/phpBB/styles/prosilver/template/editor.js
@@ -200,6 +200,12 @@ function addquote(post_id, username, l_wrote)
var theSelection = '';
var divarea = false;
+ if (l_wrote === undefined)
+ {
+ // Backwards compatibility
+ l_wrote = 'wrote';
+ }
+
if (document.all)
{
divarea = document.all[message_name];
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index 879e6bb7fc..a05f057e21 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -24,7 +24,7 @@
<div class="postbody" id="pr{topic_review_row.POST_ID}">
<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
<ul class="profile-icons">
- <li class="quote-icon"><a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{L_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}"><span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span></a></li>
+ <li class="quote-icon"><a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}"><span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span></a></li>
</ul>
<!-- ENDIF -->
<!-- IF topic_review_row.U_MCP_DETAILS --><div class="right-box"><a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a></div><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index 32b8072082..c555e90640 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -17,7 +17,7 @@
<div class="postbody" id="pr{history_row.MSG_ID}">
<!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
<ul class="profile-icons">
- <li class="quote-icon"><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{L_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}"><span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span></a></li>
+ <li class="quote-icon"><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}"><span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span></a></li>
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
index d54994fe67..833bd4d55f 100644
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ b/phpBB/styles/subsilver2/template/attachment.html
@@ -58,13 +58,13 @@
<!-- ELSEIF _file.S_FLASH_FILE -->
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}">
- <param name="movie" value="{_file.U_DOWNLOAD_LINK}" />
+ <param name="movie" value="{_file.U_VIEW_LINK}" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="quality" value="high" />
<param name="allowScriptAccess" value="never" />
<param name="allowNetworking" value="internal" />
- <embed src="{_file.U_DOWNLOAD_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
+ <embed src="{_file.U_VIEW_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
</object>
<!-- ELSEIF _file.S_QUICKTIME_FILE -->
<object id="qtstream_{_file.ATTACH_ID}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="0" height="16">
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js
index 54bd3450d0..e340bc74b5 100644
--- a/phpBB/styles/subsilver2/template/editor.js
+++ b/phpBB/styles/subsilver2/template/editor.js
@@ -202,6 +202,12 @@ function addquote(post_id, username, l_wrote)
var theSelection = '';
var divarea = false;
+ if (l_wrote === undefined)
+ {
+ // Backwards compatibility
+ l_wrote = 'wrote';
+ }
+
if (document.all)
{
divarea = document.all[message_name];
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
index 863e4f7bee..8faf76e9ee 100644
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ b/phpBB/styles/subsilver2/template/index_body.html
@@ -89,11 +89,11 @@
<table class="legend">
<tr>
- <td width="20" align="center">{FORUM_NEW_IMG}</td>
- <td><span class="gensmall">{L_NEW_POSTS}</span></td>
+ <td width="20" align="center">{FORUM_UNREAD_IMG}</td>
+ <td><span class="gensmall">{L_UNREAD_POSTS}</span></td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center">{FORUM_IMG}</td>
- <td><span class="gensmall">{L_NO_NEW_POSTS}</span></td>
+ <td><span class="gensmall">{L_NO_UNREAD_POSTS}</span></td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center">{FORUM_LOCKED_IMG}</td>
<td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html
index 0aab79b7aa..2fff9c1991 100644
--- a/phpBB/styles/subsilver2/template/posting_buttons.html
+++ b/phpBB/styles/subsilver2/template/posting_buttons.html
@@ -19,6 +19,7 @@
o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}',
+ a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html
index 5456ad09b6..54bbf6e553 100644
--- a/phpBB/styles/subsilver2/template/posting_topic_review.html
+++ b/phpBB/styles/subsilver2/template/posting_topic_review.html
@@ -36,7 +36,7 @@
<td>&nbsp;</td>
<td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b>&nbsp;</td>
<td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td>
- <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{L_WROTE}'); return false;">{QUOTE_IMG}</a><!-- ENDIF --></td>
+ <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}'); return false;">{QUOTE_IMG}</a><!-- ENDIF --></td>
</tr>
</table>
</td>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html
index d11822cc39..53391b30c9 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_history.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html
@@ -59,7 +59,7 @@
<!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td class="gensmall"><a href="{history_row.U_VIEW_MESSAGE}">{L_VIEW_PM}</a></td>
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{L_WROTE}'); return false;"<!-- ENDIF -->>{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
+ <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}'); return false;"<!-- ENDIF -->>{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
</tr>
<tr>
<td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index 387a749e24..6511fa5349 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -281,31 +281,31 @@
<td align="{S_CONTENT_FLOW_BEGIN}" valign="top">
<table cellspacing="3" cellpadding="0" border="0">
<tr>
- <td width="20" style="text-align: center;">{FOLDER_NEW_IMG}</td>
- <td class="gensmall">{L_NEW_POSTS}</td>
+ <td width="20" style="text-align: center;">{FOLDER_UNREAD_IMG}</td>
+ <td class="gensmall">{L_UNREAD_POSTS}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" style="text-align: center;">{FOLDER_IMG}</td>
- <td class="gensmall">{L_NO_NEW_POSTS}</td>
+ <td class="gensmall">{L_NO_UNREAD_POSTS}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" style="text-align: center;">{FOLDER_ANNOUNCE_IMG}</td>
<td class="gensmall">{L_ICON_ANNOUNCEMENT}</td>
</tr>
<tr>
- <td style="text-align: center;">{FOLDER_HOT_NEW_IMG}</td>
- <td class="gensmall">{L_NEW_POSTS_HOT}</td>
+ <td style="text-align: center;">{FOLDER_HOT_UNREAD_IMG}</td>
+ <td class="gensmall">{L_UNREAD_POSTS_HOT}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_HOT_IMG}</td>
- <td class="gensmall">{L_NO_NEW_POSTS_HOT}</td>
+ <td class="gensmall">{L_NO_UNREAD_POSTS_HOT}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_STICKY_IMG}</td>
<td class="gensmall">{L_ICON_STICKY}</td>
</tr>
<tr>
- <td style="text-align: center;">{FOLDER_LOCKED_NEW_IMG}</td>
- <td class="gensmall">{L_NEW_POSTS_LOCKED}</td>
+ <td style="text-align: center;">{FOLDER_LOCKED_UNREAD_IMG}</td>
+ <td class="gensmall">{L_UNREAD_POSTS_LOCKED}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_LOCKED_IMG}</td>
- <td class="gensmall">{L_NO_NEW_POSTS_LOCKED}</td>
+ <td class="gensmall">{L_NO_UNREAD_POSTS_LOCKED}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_MOVED_IMG}</td>
<td class="gensmall">{L_TOPIC_MOVED}</td>
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index d18508ccbc..9cfa93f880 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -273,16 +273,16 @@ $template->assign_vars(array(
'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt),
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
- 'FOLDER_IMG' => $user->img('topic_read', 'NO_NEW_POSTS'),
- 'FOLDER_NEW_IMG' => $user->img('topic_unread', 'NEW_POSTS'),
- 'FOLDER_HOT_IMG' => $user->img('topic_read_hot', 'NO_NEW_POSTS_HOT'),
- 'FOLDER_HOT_NEW_IMG' => $user->img('topic_unread_hot', 'NEW_POSTS_HOT'),
- 'FOLDER_LOCKED_IMG' => $user->img('topic_read_locked', 'NO_NEW_POSTS_LOCKED'),
- 'FOLDER_LOCKED_NEW_IMG' => $user->img('topic_unread_locked', 'NEW_POSTS_LOCKED'),
+ 'FOLDER_IMG' => $user->img('topic_read', 'NO_UNREAD_POSTS'),
+ 'FOLDER_UNREAD_IMG' => $user->img('topic_unread', 'UNREAD_POSTS'),
+ 'FOLDER_HOT_IMG' => $user->img('topic_read_hot', 'NO_UNREAD_POSTS_HOT'),
+ 'FOLDER_HOT_UNREAD_IMG' => $user->img('topic_unread_hot', 'UNREAD_POSTS_HOT'),
+ 'FOLDER_LOCKED_IMG' => $user->img('topic_read_locked', 'NO_UNREAD_POSTS_LOCKED'),
+ 'FOLDER_LOCKED_UNREAD_IMG' => $user->img('topic_unread_locked', 'UNREAD_POSTS_LOCKED'),
'FOLDER_STICKY_IMG' => $user->img('sticky_read', 'POST_STICKY'),
- 'FOLDER_STICKY_NEW_IMG' => $user->img('sticky_unread', 'POST_STICKY'),
+ 'FOLDER_STICKY_UNREAD_IMG' => $user->img('sticky_unread', 'POST_STICKY'),
'FOLDER_ANNOUNCE_IMG' => $user->img('announce_read', 'POST_ANNOUNCEMENT'),
- 'FOLDER_ANNOUNCE_NEW_IMG' => $user->img('announce_unread', 'POST_ANNOUNCEMENT'),
+ 'FOLDER_ANNOUNCE_UNREAD_IMG'=> $user->img('announce_unread', 'POST_ANNOUNCEMENT'),
'FOLDER_MOVED_IMG' => $user->img('topic_moved', 'TOPIC_MOVED'),
'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
@@ -508,6 +508,7 @@ if (sizeof($shadow_topic_list))
'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'],
'topic_status' => $rowset[$orig_topic_id]['topic_status'],
'topic_type' => $rowset[$orig_topic_id]['topic_type'],
+ 'topic_title' => $rowset[$orig_topic_id]['topic_title'],
));
// Shadow topics are never reported
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 8e0521522d..8926d5a40b 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1513,7 +1513,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'EDIT_REASON' => $row['post_edit_reason'],
'BUMPED_MESSAGE' => $l_bumped_by,
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'POST_ICON_IMG' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '',
'POST_ICON_IMG_WIDTH' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '',
'POST_ICON_IMG_HEIGHT' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '',
diff --git a/tests/RUNNING_TESTS.txt b/tests/RUNNING_TESTS.txt
new file mode 100644
index 0000000000..f1b40f71ad
--- /dev/null
+++ b/tests/RUNNING_TESTS.txt
@@ -0,0 +1,33 @@
+Running Tests
+-------------
+
+Prerequisites
+-------------
+
+PHPUnit
+=======
+
+phpBB unit tests use PHPUnit framework. Version 3.3 or better is required
+to run the tests. PHPUnit prefers to be installed via PEAR; refer to
+http://www.phpunit.de/ for more information.
+
+PHP extensions
+==============
+
+Unit tests use several PHP extensions that board code does not use. Currently
+the following PHP extensions must be installed and enabled to run unit tests:
+
+- ctype
+
+Running
+-------
+
+Once the prerequisites are installed, run the tests from tests directory:
+
+$ phpunit all_tests.php
+
+More Information
+----------------
+
+Further information is available on phpbb wiki:
+http://wiki.phpbb.com/display/DEV/Unit+Tests
diff --git a/tests/regex/email.php b/tests/regex/email.php
index b1519dfa5f..8658b8af36 100644
--- a/tests/regex/email.php
+++ b/tests/regex/email.php
@@ -33,6 +33,27 @@ class phpbb_regex_email_test extends phpbb_test_case
//array('"John Doe"@example.com'),
//array('Alice@[192.168.2.1]'), // IPv4
//array('Bob@[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]'), // IPv6
+
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ array('l3tt3rsAndNumb3rs@domain.com'),
+ array('has-dash@domain.com'),
+ array('hasApostrophe.o\'leary@domain.org'),
+ array('uncommonTLD@domain.museum'),
+ array('uncommonTLD@domain.travel'),
+ array('uncommonTLD@domain.mobi'),
+ array('countryCodeTLD@domain.uk'),
+ array('countryCodeTLD@domain.rw'),
+ array('numbersInDomain@911.com'),
+ array('underscore_inLocal@domain.net'),
+ array('IPInsteadOfDomain@127.0.0.1'),
+ array('IPAndPort@127.0.0.1:25'),
+ array('subdomain@sub.domain.com'),
+ array('local@dash-inDomain.com'),
+ array('dot.inLocal@foo.com'),
+ array('a@singleLetterLocal.org'),
+ array('singleLetterDomain@x.org'),
+ array('&amp;*=?^+{}\'~@validCharsInLocal.net'),
+ array('foor@bar.newTLD'),
);
}
@@ -56,6 +77,26 @@ class phpbb_regex_email_test extends phpbb_test_case
array('abc,def@example.com'), // invalid character ,
array('abc<def@example.com'), // invalid character <
array('abc>def@example.com'), // invalid character >
+
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ array('missingDomain@.com'),
+ array('@missingLocal.org'),
+ array('missingatSign.net'),
+ array('missingDot@com'),
+ array('two@@signs.com'),
+ array('colonButNoPort@127.0.0.1:'),
+ array(''),
+ array('someone-else@127.0.0.1.26'),
+ array('.localStartsWithDot@domain.com'),
+ array('localEndsWithDot.@domain.com'),
+ array('two..consecutiveDots@domain.com'),
+ array('domainStartsWithDash@-domain.com'),
+ array('domainEndsWithDash@domain-.com'),
+ array('numbersInTLD@domain.c0m'),
+ array('missingTLD@domain.'),
+ array('! "#$%(),/;<>[]`|@invalidCharsInLocal.org'),
+ array('invalidCharsInDomain@! "#$%(),/;<>_[]`|.org'),
+ array('local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org'),
);
}
@@ -70,7 +111,7 @@ class phpbb_regex_email_test extends phpbb_test_case
/**
* @dataProvider negative_match_data
*/
- public function test_negative_match($address)
+ public function test_negative_match($email)
{
$this->assertEquals(0, preg_match($this->regex, $email));
}
diff --git a/tests/template/template.php b/tests/template/template.php
index 145fe8de61..024d3712f7 100644
--- a/tests/template/template.php
+++ b/tests/template/template.php
@@ -26,12 +26,24 @@ class phpbb_template_template_test extends phpbb_test_case
error_reporting($error_level & ~E_NOTICE);
ob_start();
- $this->assertTrue($this->template->display($handle, false));
+
+ try
+ {
+ $this->assertTrue($this->template->display($handle, false));
+ }
+ catch (Exception $exception)
+ {
+ // reset the error level even when an error occured
+ // PHPUnit turns trigger_error into exceptions as well
+ error_reporting($error_level);
+ throw $exception;
+ }
+
+ $result = self::trim_template_result(ob_get_clean());
// reset error level
error_reporting($error_level);
-
- return self::trim_template_result(ob_get_clean());
+ return $result;
}
private static function trim_template_result($result)
@@ -368,9 +380,15 @@ class phpbb_template_template_test extends phpbb_test_case
$this->template->destroy_block_vars($block);
}
+ $error_level = error_reporting();
+ error_reporting($error_level & ~E_NOTICE);
+
$this->assertEquals($expected, self::trim_template_result($this->template->assign_display('test')), "Testing assign_display($file)");
$this->template->assign_display('test', 'VARIABLE', false);
+
+ error_reporting($error_level);
+
$this->assertEquals($expected, $this->display('container'), "Testing assign_display($file)");
}