aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.travis.yml25
-rw-r--r--README.md6
-rw-r--r--phpBB/common.php2
-rw-r--r--phpBB/develop/create_schema_files.php1
-rw-r--r--phpBB/develop/create_search_index.php2
-rw-r--r--phpBB/develop/extensions.php8
-rw-r--r--phpBB/docs/INSTALL.html2
-rw-r--r--phpBB/docs/README.html4
-rw-r--r--phpBB/docs/coding-guidelines.html6
-rw-r--r--phpBB/includes/acp/acp_main.php4
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/extension/controller_interface.php31
-rw-r--r--phpBB/includes/extension/manager.php26
-rw-r--r--phpBB/includes/functions_module.php24
-rw-r--r--phpBB/includes/functions_posting.php46
-rw-r--r--phpBB/includes/functions_privmsgs.php17
-rw-r--r--phpBB/includes/functions_user.php33
-rw-r--r--phpBB/includes/mcp/mcp_reports.php9
-rw-r--r--phpBB/includes/mcp/mcp_topic.php11
-rw-r--r--phpBB/includes/startup.php3
-rw-r--r--phpBB/index.php33
-rw-r--r--phpBB/install/database_update.php3
-rw-r--r--phpBB/install/index.php4
-rw-r--r--phpBB/install/install_install.php2
-rw-r--r--phpBB/install/schemas/firebird_schema.sql3
-rw-r--r--phpBB/install/schemas/mssql_schema.sql3
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1
-rw-r--r--phpBB/install/schemas/oracle_schema.sql1
-rw-r--r--phpBB/install/schemas/postgres_schema.sql1
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql3
-rw-r--r--phpBB/language/en/common.php4
-rw-r--r--phpBB/language/en/install.php4
-rw-r--r--phpBB/language/en/mcp.php1
-rw-r--r--phpBB/memberlist.php1
-rw-r--r--phpBB/report.php10
-rw-r--r--phpBB/styles/prosilver/template/mcp_queue.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html3
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html2
-rw-r--r--phpBB/styles/prosilver/theme/common.css81
-rw-r--r--phpBB/styles/subsilver2/template/mcp_queue.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html1
-rw-r--r--phpBB/styles/subsilver2/template/posting_topic_review.html7
-rw-r--r--phpunit.xml.all4
-rw-r--r--phpunit.xml.dist4
-rw-r--r--phpunit.xml.functional4
-rw-r--r--tests/bootstrap.php6
-rw-r--r--tests/functional/extension_controller_test.php153
-rw-r--r--tests/functional/fixtures/ext/error/class/controller.php17
-rw-r--r--tests/functional/fixtures/ext/error/class/ext.php6
-rw-r--r--tests/functional/fixtures/ext/error/classtype/controller.php17
-rw-r--r--tests/functional/fixtures/ext/error/classtype/ext.php6
-rw-r--r--tests/functional/fixtures/ext/error/disabled/controller.php17
-rw-r--r--tests/functional/fixtures/ext/error/disabled/ext.php6
-rw-r--r--tests/functional/fixtures/ext/foo/bar/controller.php17
-rw-r--r--tests/functional/fixtures/ext/foo/bar/ext.php6
-rw-r--r--tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar_body.html5
-rw-r--r--tests/functional/fixtures/ext/foobar/controller.php17
-rw-r--r--tests/functional/fixtures/ext/foobar/ext.php6
-rw-r--r--tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html5
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php58
-rw-r--r--travis/phpunit-mysql-travis.xml34
-rw-r--r--travis/phpunit-postgres-travis.xml36
65 files changed, 766 insertions, 97 deletions
diff --git a/.gitignore b/.gitignore
index d875beb784..e6e017f85e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,8 @@
/phpBB/cache/*.php
/phpBB/cache/queue.php.lock
/phpBB/config.php
+/phpBB/config_dev.php
+/phpBB/config_test.php
/phpBB/ext/*
/phpBB/files/*
/phpBB/images/avatars/gallery/*
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..d5e1231584
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,25 @@
+language: php
+php:
+ - 5.3.2
+ - 5.4
+
+env:
+ - DB=mysql
+ - DB=postgres
+
+before_script:
+ - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi"
+ - phpenv rehash
+
+script:
+ - phpunit --configuration travis/phpunit-$DB-travis.xml
+
+notifications:
+ email:
+ recipients:
+ - dev-team@phpbb.com
+ on_success: change
+ on_failure: change
diff --git a/README.md b/README.md
index 6b94f898a3..51e65176c6 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,12 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev
3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
4. Send us a pull request
+## AUTOMATED TESTING
+
+We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below.
+develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3)
+develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3)
+
## LICENSE
[GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php)
diff --git a/phpBB/common.php b/phpBB/common.php
index dd49b29528..5c468d74a2 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -5,7 +5,7 @@
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
-* Minimum Requirement: PHP 5.2.0
+* Minimum Requirement: PHP 5.3.2
*/
/**
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 80ba1b251a..4088657743 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1528,6 +1528,7 @@ function get_schema_struct()
'report_closed' => array('BOOL', 0),
'report_time' => array('TIMESTAMP', 0),
'report_text' => array('MTEXT_UNI', ''),
+ 'reported_post_text' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'report_id',
'KEYS' => array(
diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php
index 1de20f3099..f329b805a0 100644
--- a/phpBB/develop/create_search_index.php
+++ b/phpBB/develop/create_search_index.php
@@ -35,7 +35,6 @@ $search_errors = array();
$search = new $class_name($search_errors);
$batch_size = isset($argv[2]) ? $argv[2] : 2000;
-$time = time();
if (method_exists($search, 'create_index'))
{
@@ -67,6 +66,7 @@ else
while ($post_counter <= $max_post_id)
{
$row_count = 0;
+ $time = time();
printf("Processing posts with %d <= post_id <= %d\n",
$post_counter + 1,
diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php
index 2f7c3d1167..43621f3080 100644
--- a/phpBB/develop/extensions.php
+++ b/phpBB/develop/extensions.php
@@ -37,6 +37,13 @@ function list_extensions()
global $phpbb_extension_manager;
$phpbb_extension_manager->load_extensions();
+ $all = array_keys($phpbb_extension_manager->all_available());
+
+ if (empty($all))
+ {
+ echo "There were no extensions found.\n";
+ exit(3);
+ }
echo "Enabled:\n";
$enabled = array_keys($phpbb_extension_manager->all_enabled());
@@ -49,7 +56,6 @@ function list_extensions()
echo "\n";
echo "Available:\n";
- $all = array_keys($phpbb_extension_manager->all_available());
$purged = array_diff($all, $enabled, $disabled);
print_extensions($purged);
}
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index 9b27ac06bc..e3d56baa36 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -138,7 +138,7 @@
<li>Oracle</li>
</ul>
</li>
- <li><strong>PHP 5.2.0+</strong> with support for the database you intend to use.</li>
+ <li><strong>PHP 5.3.2+</strong> with support for the database you intend to use.</li>
<li>getimagesize() function need to be enabled.</li>
<li>These optional presence of the following modules within PHP will provide access to additional features, but they are not required.
<ul>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 592d2be76e..ccd368fbde 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -306,11 +306,11 @@
<div class="content">
- <p>phpBB is no longer supported on PHP4 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.2.0.</p>
+ <p>phpBB is no longer supported on PHP4 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.2.</p>
<p>Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
- <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.2.0 to 5.3.x without problem.</p>
+ <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.3.2 to 5.4.x without problem.</p>
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index e85be02d45..f8aaf77441 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -2348,7 +2348,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
-'FOO_BAR' =&gt; 'PHP version &lt; 5.2.0.&lt;br /&gt;
+'FOO_BAR' =&gt; 'PHP version &lt; 5.3.2.&lt;br /&gt;
Visit &quot;Downloads&quot; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
...
</pre></div>
@@ -2357,7 +2357,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
-'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.2.0.&lt;br /&gt;
+'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.3.2.&lt;br /&gt;
Visit &amp;quot;Downloads&amp;quot; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
...
</pre></div>
@@ -2366,7 +2366,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
-'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.2.0.&lt;br /&gt;
+'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.3.2.&lt;br /&gt;
Visit &ldquo;Downloads&rdquo; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
...
</pre></div>
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index b30c294ce2..88c29702d4 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -397,11 +397,11 @@ class acp_main
// Version check
$user->add_lang('install');
- if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.2.0', '<'))
+ if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.2', '<'))
{
$template->assign_vars(array(
'S_PHP_VERSION_OLD' => true,
- 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="http://www.phpbb.com/community/viewtopic.php?f=14&amp;t=1958605">', '</a>'),
+ 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="http://www.phpbb.com/community/viewtopic.php?f=14&amp;t=2152375">', '</a>'),
));
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 97f4b1b5fd..cf6716c322 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -128,7 +128,7 @@ class acp_users
$dropdown_modes = array();
while ($row = $db->sql_fetchrow($result))
{
- if (!$this->p_master->module_auth($row['module_auth']))
+ if (!$this->p_master->module_auth_self($row['module_auth']))
{
continue;
}
diff --git a/phpBB/includes/extension/controller_interface.php b/phpBB/includes/extension/controller_interface.php
new file mode 100644
index 0000000000..bcc8972db4
--- /dev/null
+++ b/phpBB/includes/extension/controller_interface.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* @package extension
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* The interface that extension classes have to implement to run front pages
+*
+* @package extension
+*/
+interface phpbb_extension_controller_interface
+{
+ /**
+ * handle the request to display a page from an extension
+ *
+ * @return null
+ */
+ public function handle();
+}
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index c38f0df32e..537c19aff8 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -352,6 +352,10 @@ class phpbb_extension_manager
public function all_available()
{
$available = array();
+ if (!is_dir($this->phpbb_root_path . 'ext/'))
+ {
+ return $available;
+ }
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'),
@@ -428,6 +432,28 @@ class phpbb_extension_manager
}
return $disabled;
}
+
+ /**
+ * Check to see if a given extension is available on the filesystem
+ *
+ * @param string $name Extension name to check NOTE: Can be user input
+ * @return bool Depending on whether or not the extension is available
+ */
+ public function available($name)
+ {
+ return file_exists($this->get_extension_path($name, true));
+ }
+
+ /**
+ * Check to see if a given extension is enabled
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is enabled
+ */
+ public function enabled($name)
+ {
+ return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active'];
+ }
/**
* Instantiates a phpbb_extension_finder.
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index db7defdc48..ad76be9f2f 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -128,7 +128,7 @@ class p_master
foreach ($this->module_cache['modules'] as $key => $row)
{
// Not allowed to view module?
- if (!$this->module_auth($row['module_auth']))
+ if (!$this->module_auth_self($row['module_auth']))
{
unset($this->module_cache['modules'][$key]);
continue;
@@ -315,9 +315,23 @@ class p_master
}
/**
- * Check module authorisation
+ * Check module authorisation.
+ *
+ * This is a non-static version that uses $this->acl_forum_id
+ * for the forum id.
+ */
+ function module_auth_self($module_auth)
+ {
+ return self::module_auth($module_auth, $this->acl_forum_id);
+ }
+
+ /**
+ * Check module authorisation.
+ *
+ * This is a static version, it must be given $forum_id.
+ * See also module_auth_self.
*/
- function module_auth($module_auth, $forum_id = false)
+ static function module_auth($module_auth, $forum_id)
{
global $auth, $config;
global $request;
@@ -362,11 +376,9 @@ class p_master
$module_auth = implode(' ', $tokens);
- // Make sure $id seperation is working fine
+ // Make sure $id separation is working fine
$module_auth = str_replace(' , ', ',', $module_auth);
- $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
-
$is_auth = false;
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '$request->variable(\'\\1\', false)'), $module_auth) . ');');
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 4e4ce5bca7..b3816baedd 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1180,36 +1180,32 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
$topic_title = ($topic_notification) ? $topic_title : $subject;
$topic_title = censor_text($topic_title);
- // Get banned User ID's
- $sql = 'SELECT ban_userid
- FROM ' . BANLIST_TABLE . '
- WHERE ban_userid <> 0
- AND ban_exclude <> 1';
- $result = $db->sql_query($sql);
-
- $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id'];
- while ($row = $db->sql_fetchrow($result))
+ // Exclude guests, current user and banned users from notifications
+ if (!function_exists('phpbb_get_banned_user_ids'))
{
- $sql_ignore_users .= ', ' . (int) $row['ban_userid'];
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
- $db->sql_freeresult($result);
+ $sql_ignore_users = phpbb_get_banned_user_ids();
+ $sql_ignore_users[ANONYMOUS] = ANONYMOUS;
+ $sql_ignore_users[$user->data['user_id']] = $user->data['user_id'];
$notify_rows = array();
// -- get forum_userids || topic_userids
$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u
- WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . "
- AND w.user_id NOT IN ($sql_ignore_users)
- AND w.notify_status = " . NOTIFY_YES . '
+ WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . '
+ AND ' . $db->sql_in_set('w.user_id', $sql_ignore_users, true) . '
+ AND w.notify_status = ' . NOTIFY_YES . '
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
AND u.user_id = w.user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- $notify_rows[$row['user_id']] = array(
- 'user_id' => $row['user_id'],
+ $notify_user_id = (int) $row['user_id'];
+ $notify_rows[$notify_user_id] = array(
+ 'user_id' => $notify_user_id,
'username' => $row['username'],
'user_email' => $row['user_email'],
'user_jabber' => $row['user_jabber'],
@@ -1219,30 +1215,29 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
'method' => $row['user_notify_type'],
'allowed' => false
);
+
+ // Add users who have been already notified to ignore list
+ $sql_ignore_users[$notify_user_id] = $notify_user_id;
}
$db->sql_freeresult($result);
// forum notification is sent to those not already receiving topic notifications
if ($topic_notification)
{
- if (sizeof($notify_rows))
- {
- $sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows));
- }
-
$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u
WHERE fw.forum_id = $forum_id
- AND fw.user_id NOT IN ($sql_ignore_users)
- AND fw.notify_status = " . NOTIFY_YES . '
+ AND " . $db->sql_in_set('fw.user_id', $sql_ignore_users, true) . '
+ AND fw.notify_status = ' . NOTIFY_YES . '
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
AND u.user_id = fw.user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- $notify_rows[$row['user_id']] = array(
- 'user_id' => $row['user_id'],
+ $notify_user_id = (int) $row['user_id'];
+ $notify_rows[$notify_user_id] = array(
+ 'user_id' => $notify_user_id,
'username' => $row['username'],
'user_email' => $row['user_email'],
'user_jabber' => $row['user_jabber'],
@@ -1273,7 +1268,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
}
}
-
// Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;)
$msg_users = $delete_ids = $update_notification = array();
foreach ($notify_rows as $user_id => $row)
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 91e453b8e0..a6fb87536a 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1666,6 +1666,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
$subject = censor_text($subject);
+ // Exclude guests, current user and banned users from notifications
unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]);
if (!sizeof($recipients))
@@ -1673,18 +1674,12 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
return;
}
- // Get banned User ID's
- $sql = 'SELECT ban_userid
- FROM ' . BANLIST_TABLE . '
- WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . '
- AND ban_exclude = 0';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
+ if (!function_exists('phpbb_get_banned_user_ids'))
{
- unset($recipients[$row['ban_userid']]);
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
- $db->sql_freeresult($result);
+ $banned_users = phpbb_get_banned_user_ids(array_keys($recipients));
+ $recipients = array_diff(array_keys($recipients), $banned_users);
if (!sizeof($recipients))
{
@@ -1693,7 +1688,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
$sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients)));
+ WHERE ' . $db->sql_in_set('user_id', $recipients);
$result = $db->sql_query($sql);
$msg_list_ary = array();
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 509e1a953c..18452c27e9 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -3691,3 +3691,36 @@ function remove_newly_registered($user_id, $user_data = false)
return $user_data['group_id'];
}
+
+/**
+* Gets user ids of currently banned registered users.
+*
+* @param array $user_ids Array of users' ids to check for banning,
+* leave empty to get complete list of banned ids
+* @return array Array of banned users' ids if any, empty array otherwise
+*/
+function phpbb_get_banned_user_ids($user_ids = array())
+{
+ global $db;
+
+ $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0';
+
+ // Get banned User ID's
+ // Ignore stale bans which were not wiped yet
+ $banned_ids_list = array();
+ $sql = 'SELECT ban_userid
+ FROM ' . BANLIST_TABLE . "
+ WHERE $sql_user_ids
+ AND ban_exclude <> 1
+ AND (ban_end > " . time() . '
+ OR ban_end = 0)';
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $user_id = (int) $row['ban_userid'];
+ $banned_ids_list[$user_id] = $user_id;
+ }
+ $db->sql_freeresult($result);
+
+ return $banned_ids_list;
+}
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 95e84e816b..69c6a4cfff 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -71,7 +71,7 @@ class mcp_reports
// closed reports are accessed by report id
$report_id = request_var('r', 0);
- $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
+ $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
AND rr.reason_id = r.reason_id
@@ -116,8 +116,9 @@ class mcp_reports
$template->assign_vars(array(
'S_TOPIC_REVIEW' => true,
'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'],
- 'TOPIC_TITLE' => $post_info['topic_title'])
- );
+ 'TOPIC_TITLE' => $post_info['topic_title'],
+ 'REPORTED_POST_ID' => $post_id,
+ ));
}
$topic_tracking_info = $extensions = $attachments = array();
@@ -226,7 +227,7 @@ class mcp_reports
'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
- 'POST_PREVIEW' => $message,
+ 'POST_PREVIEW' => bbcode_nl2br($report['reported_post_text']),
'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
'POST_DATE' => $user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 598b470663..d4ba89b04c 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -49,6 +49,16 @@ function mcp_topic_view($id, $mode, $action)
$submitted_id_list = request_var('post_ids', array(0));
$checked_ids = $post_id_list = request_var('post_id_list', array(0));
+ // Resync Topic?
+ if ($action == 'resync')
+ {
+ if (!function_exists('mcp_resync_topics'))
+ {
+ include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
+ }
+ mcp_resync_topics(array($topic_id));
+ }
+
// Split Topic?
if ($action == 'split_all' || $action == 'split_beyond')
{
@@ -319,6 +329,7 @@ function mcp_topic_view($id, $mode, $action)
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false,
+ 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']),
'S_REPORT_VIEW' => ($action == 'reports') ? true : false,
'S_MERGE_VIEW' => ($action == 'merge') ? true : false,
'S_SPLIT_VIEW' => ($action == 'split') ? true : false,
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 2100fbd97e..fc45cd882b 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -19,7 +19,8 @@ if (!defined('E_DEPRECATED'))
{
define('E_DEPRECATED', 8192);
}
-error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
+$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
+error_reporting($level);
/*
* Remove variables created by register_globals from the global scope
diff --git a/phpBB/index.php b/phpBB/index.php
index f1243bb336..d71878a885 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -24,6 +24,39 @@ $user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
+// Handle the display of extension front pages
+if ($ext = $request->variable('ext', ''))
+{
+ $class = 'phpbb_ext_' . str_replace('/', '_', $ext) . '_controller';
+
+ if (!$phpbb_extension_manager->available($ext))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error($user->lang('EXTENSION_DOES_NOT_EXIST', $ext));
+ }
+ else if (!$phpbb_extension_manager->enabled($ext))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error($user->lang('EXTENSION_DISABLED', $ext));
+ }
+ else if (!class_exists($class))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error($user->lang('EXTENSION_CONTROLLER_MISSING', $ext));
+ }
+
+ $controller = new $class;
+
+ if (!($controller instanceof phpbb_extension_controller_interface))
+ {
+ send_status_line(500, 'Internal Server Error');
+ trigger_error($user->lang('EXTENSION_CLASS_WRONG_TYPE', $class));
+ }
+
+ $controller->handle();
+ exit_handler();
+}
+
display_forums('', $config['load_moderators']);
$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 995f4c9a95..3e56112713 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1094,6 +1094,9 @@ function database_update_info()
'style_parent_id' => array('UINT:4', 0),
'style_parent_tree' => array('TEXT', ''),
),
+ REPORTS_TABLE => array(
+ 'reported_post_text' => array('MTEXT_UNI', ''),
+ ),
),
'change_columns' => array(
GROUPS_TABLE => array(
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 1f013df72b..f3664c177c 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -17,9 +17,9 @@ define('IN_INSTALL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-if (version_compare(PHP_VERSION, '5.2.0') < 0)
+if (version_compare(PHP_VERSION, '5.3.2') < 0)
{
- die('You are running an unsupported PHP version. Please upgrade to PHP 5.2.0 or higher before trying to install phpBB 3.1');
+ die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.2 or higher before trying to install phpBB 3.1');
}
function phpbb_require_updated($path, $optional = false)
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 4663b5204e..361376763d 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -140,7 +140,7 @@ class install_install extends module
// Test the minimum PHP version
$php_version = PHP_VERSION;
- if (version_compare($php_version, '5.2.0') < 0)
+ if (version_compare($php_version, '5.3.2') < 0)
{
$result = '<strong style="color:red">' . $lang['NO'] . '</strong>';
}
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index adea0b4cc2..51565ef2d4 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -909,7 +909,8 @@ CREATE TABLE phpbb_reports (
user_notify INTEGER DEFAULT 0 NOT NULL,
report_closed INTEGER DEFAULT 0 NOT NULL,
report_time INTEGER DEFAULT 0 NOT NULL,
- report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
+ report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
);;
ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 292a85b816..2c78dd009f 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -1108,7 +1108,8 @@ CREATE TABLE [phpbb_reports] (
[user_notify] [int] DEFAULT (0) NOT NULL ,
[report_closed] [int] DEFAULT (0) NOT NULL ,
[report_time] [int] DEFAULT (0) NOT NULL ,
- [report_text] [text] DEFAULT ('') NOT NULL
+ [report_text] [text] DEFAULT ('') NOT NULL ,
+ [reported_post_text] [text] DEFAULT ('') NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 13d0199b8a..d19f1930d0 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -647,6 +647,7 @@ CREATE TABLE phpbb_reports (
report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
report_text mediumblob NOT NULL,
+ reported_post_text mediumblob NOT NULL,
PRIMARY KEY (report_id),
KEY post_id (post_id),
KEY pm_id (pm_id)
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index c26cb89f37..3fd8d4f1d1 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -647,6 +647,7 @@ CREATE TABLE phpbb_reports (
report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
report_text mediumtext NOT NULL,
+ reported_post_text mediumtext NOT NULL,
PRIMARY KEY (report_id),
KEY post_id (post_id),
KEY pm_id (pm_id)
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 23bdebdb8a..8a0f3e56b1 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1214,6 +1214,7 @@ CREATE TABLE phpbb_reports (
report_closed number(1) DEFAULT '0' NOT NULL,
report_time number(11) DEFAULT '0' NOT NULL,
report_text clob DEFAULT '' ,
+ reported_post_text clob DEFAULT '' ,
CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id)
)
/
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index d18cb08539..c624024362 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -853,6 +853,7 @@ CREATE TABLE phpbb_reports (
report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0),
report_text TEXT DEFAULT '' NOT NULL,
+ reported_post_text TEXT DEFAULT '' NOT NULL,
PRIMARY KEY (report_id)
);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index c5f417961d..bd002c93ed 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -627,7 +627,8 @@ CREATE TABLE phpbb_reports (
user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_text mediumtext(16777215) NOT NULL DEFAULT ''
+ report_text mediumtext(16777215) NOT NULL DEFAULT '',
+ reported_post_text mediumtext(16777215) NOT NULL DEFAULT ''
);
CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 7741ff8d1f..94edddc6f5 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -185,7 +185,11 @@ $lang = array_merge($lang, array(
'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path specified appears to be invalid.',
'EXPAND_VIEW' => 'Expand view',
'EXTENSION' => 'Extension',
+ 'EXTENSION_CONTROLLER_MISSING' => 'The extension <strong>%s</strong> is missing a controller class and cannot be accessed through the front-end.',
+ 'EXTENSION_CLASS_WRONG_TYPE' => 'The extension controller class <strong>%s</strong> is not an instance of the phpbb_extension_controller_interface.',
+ 'EXTENSION_DISABLED' => 'The extension <strong>%s</strong> is not enabled.',
'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed.',
+ 'EXTENSION_DOES_NOT_EXIST' => 'The extension <strong>%s</strong> does not exist.',
'FAQ' => 'FAQ',
'FAQ_EXPLAIN' => 'Frequently Asked Questions',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 254db4a5c1..ca6045a921 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -300,10 +300,10 @@ $lang = array_merge($lang, array(
'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.',
'PHP_SAFE_MODE' => 'Safe mode',
'PHP_SETTINGS' => 'PHP version and settings',
- 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.2.0 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
+ 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.3.2 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
'PHP_URL_FOPEN_SUPPORT' => 'PHP setting <var>allow_url_fopen</var> is enabled',
'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '<strong>Optional</strong> - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it.',
- 'PHP_VERSION_REQD' => 'PHP version >= 5.2.0',
+ 'PHP_VERSION_REQD' => 'PHP version >= 5.3.2',
'POST_ID' => 'Post ID',
'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using <strong>%s</strong> as table prefix.',
'PREPROCESS_STEP' => 'Executing pre-processing functions/queries',
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index 664365b1ec..bd25d403ab 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -238,6 +238,7 @@ $lang = array_merge($lang, array(
'NO_POST' => 'You have to select a post in order to warn the user for a post.',
'NO_POST_REPORT' => 'This post was not reported.',
'NO_POST_SELECTED' => 'You must select at least one post to perform this action.',
+ 'NO_POSTS_QUEUE' => 'There are no posts waiting for approval.',
'NO_REASON_DISAPPROVAL' => 'Please give an appropriate reason for disapproval.',
'NO_REPORT' => 'No report found',
'NO_REPORTS' => 'No reports found',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index cf2cb5b06d..741ac2f430 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1347,6 +1347,7 @@ switch ($mode)
if ($mode)
{
$params[] = "mode=$mode";
+ $u_first_char_params[] = "mode=$mode";
}
$sort_params[] = "mode=$mode";
diff --git a/phpBB/report.php b/phpBB/report.php
index e29001d389..29b46a6211 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -71,8 +71,9 @@ if ($post_id)
trigger_error('POST_NOT_EXIST');
}
- $forum_id = (int) $report_data['forum_id'];
- $topic_id = (int) $report_data['topic_id'];
+ $forum_id = (int) $report_data['forum_id'];
+ $topic_id = (int) $report_data['topic_id'];
+ $reported_post_text = $report_data['post_text'];
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
@@ -130,6 +131,8 @@ else
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
}
+
+ $reported_post_text = $report_data['message_text'];
}
// Submit report?
@@ -155,7 +158,8 @@ if ($submit && $reason_id)
'user_notify' => (int) $user_notify,
'report_closed' => 0,
'report_time' => (int) time(),
- 'report_text' => (string) $report_text
+ 'report_text' => (string) $report_text,
+ 'reported_post_text' => $reported_post_text,
);
$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html
index 5f16ebe7d0..f86678ebe4 100644
--- a/phpBB/styles/prosilver/template/mcp_queue.html
+++ b/phpBB/styles/prosilver/template/mcp_queue.html
@@ -78,7 +78,7 @@
</li>
</ul>
<!-- ELSE -->
- <p class="notopics"><strong><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_UNAPPROVED_POSTS_ZERO_TOTAL}<!-- ENDIF --></strong></p>
+ <p class="notopics"><strong><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF --></strong></p>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 6943dd41b3..ab0c83a56f 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -106,7 +106,7 @@ onload_functions.push('subPanels()');
<div class="inner"><span class="corners-top"><span></span></span>
<div class="postbody" id="pr{postrow.POST_ID}">
- <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li>{L_SELECT}: <input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></li></ul>
+ <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li><label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}: <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></label></li></ul>
<h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3>
<p class="author"><a href="#pr{postrow.POST_ID}">{postrow.MINI_POST_IMG}</a> {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong><!-- IF postrow.U_MCP_DETAILS --> [ <a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></p>
@@ -158,6 +158,7 @@ onload_functions.push('subPanels()');
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF S_MERGE_VIEW --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF S_SPLIT_VIEW --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
+ <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
</select>&nbsp;
<input class="button1" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}" />
<div><a href="#" onclick="marklist('mcp', 'post', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post', false); return false;">{L_UNMARK_ALL}</a></div>
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 4b41693ded..f10ec64975 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -69,7 +69,7 @@
<!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
<!-- IF S_PROFILE_FIELD1 -->
<!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <dt>{postrow.PROFILE_FIELD1_NAME}:</dt> <dd>{postrow.PROFILE_FIELD1_VALUE}</dd>
+ <dt>{PROFILE_FIELD1_NAME}:</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
</dl>
</div>
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index 67627f9785..1c4b67044d 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -17,7 +17,7 @@
<div class="inner"><span class="corners-top"><span></span></span>
{topic_review_row.L_IGNORE_POST}
<!-- ELSE -->
- <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
+ <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --> reported<!-- ENDIF -->">
<div class="inner"><span class="corners-top"><span></span></span>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 7eb00bd808..574e9ceb3a 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -1,12 +1,51 @@
-/* General Markup Styles
+/* CSS Reset http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126
---------------------------------------- */
-
-* {
- /* Reset browsers default margin, padding and font sizes */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
margin: 0;
padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
}
+/* General Markup Styles
+---------------------------------------- */
html {
font-size: 100%;
/* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */
@@ -20,6 +59,7 @@ body {
background-color: #FFFFFF;
/*font-size: 62.5%; This sets the default font size to be equivalent to 10px */
font-size: 10px;
+ line-height: normal;
margin: 0;
padding: 12px 0;
}
@@ -99,6 +139,39 @@ p.right {
text-align: right;
}
+b, strong {
+ font-weight: bold;
+}
+
+i, em {
+ font-style: italic;
+}
+
+u {
+ text-decoration: underline;
+}
+
+ul {
+ list-style-type: disc;
+}
+
+ol {
+ list-style-type: decimal;
+}
+
+li {
+ display: list-item;
+}
+
+ul ul, ol ul {
+ list-style-type: circle;
+}
+
+ol ol ul, ol ul ul, ul ol ul, ul ul ul {
+ list-style-type: square;
+}
+
+
/* Main blocks
---------------------------------------- */
#wrap {
diff --git a/phpBB/styles/subsilver2/template/mcp_queue.html b/phpBB/styles/subsilver2/template/mcp_queue.html
index 6e39ccd272..d13af91888 100644
--- a/phpBB/styles/subsilver2/template/mcp_queue.html
+++ b/phpBB/styles/subsilver2/template/mcp_queue.html
@@ -27,7 +27,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="4" height="30" align="center" valign="middle"><span class="gen"><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_UNAPPROVED_POSTS_ZERO_TOTAL}<!-- ENDIF --></span></td>
+ <td class="row1" colspan="4" height="30" align="center" valign="middle"><span class="gen"><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF --></span></td>
</tr>
<!-- END postrow -->
<tr>
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index 83c95c4ff9..8ff648da39 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -135,6 +135,7 @@
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF ACTION eq 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF ACTION eq 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
+ <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
</select>&nbsp;<input class="btnmain" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}" /></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html
index 2bfa95f3d4..cbd6746a8a 100644
--- a/phpBB/styles/subsilver2/template/posting_topic_review.html
+++ b/phpBB/styles/subsilver2/template/posting_topic_review.html
@@ -51,6 +51,13 @@
<table width="100%" cellspacing="0" cellpadding="2">
<tr>
<td>
+ <!-- IF topic_review_row.POST_ID == REPORTED_POST_ID -->
+ <table width="100%" cellspacing="0">
+ <tr>
+ <span class="postreported">{REPORTED_IMG}</span>
+ </tr>
+ </table>
+ <!-- ENDIF -->
<div class="postbody">{topic_review_row.MESSAGE}</div>
<!-- IF topic_review_row.S_HAS_ATTACHMENTS -->
diff --git a/phpunit.xml.all b/phpunit.xml.all
index b835a38c20..fde3bbb1a7 100644
--- a/phpunit.xml.all
+++ b/phpunit.xml.all
@@ -14,10 +14,6 @@
<testsuites>
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
- <exclude>./tests/functional</exclude>
- </testsuite>
- <testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
</testsuite>
</testsuites>
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index da31dce5e3..27dee48aac 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -14,10 +14,6 @@
<testsuites>
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
- <exclude>./tests/functional</exclude>
- </testsuite>
- <testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
</testsuite>
</testsuites>
diff --git a/phpunit.xml.functional b/phpunit.xml.functional
index 91d569e65b..9facbcff8b 100644
--- a/phpunit.xml.functional
+++ b/phpunit.xml.functional
@@ -14,10 +14,6 @@
<testsuites>
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
- <exclude>./tests/functional</exclude>
- </testsuite>
- <testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
</testsuite>
</testsuites>
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 302701e3b3..f103d8f15a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -25,8 +25,4 @@ require_once 'test_framework/phpbb_test_case_helpers.php';
require_once 'test_framework/phpbb_test_case.php';
require_once 'test_framework/phpbb_database_test_case.php';
require_once 'test_framework/phpbb_database_test_connection_manager.php';
-
-if (version_compare(PHP_VERSION, '5.3.0-dev', '>='))
-{
- require_once 'test_framework/phpbb_functional_test_case.php';
-}
+require_once 'test_framework/phpbb_functional_test_case.php';
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
new file mode 100644
index 0000000000..4ee0e68718
--- /dev/null
+++ b/tests/functional/extension_controller_test.php
@@ -0,0 +1,153 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_controller_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+ /**
+ * This should only be called once before the tests are run.
+ * This is used to copy the fixtures to the phpBB install
+ */
+ static public function setUpBeforeClass()
+ {
+ global $phpbb_root_path;
+ parent::setUpBeforeClass();
+
+ // these directories need to be created before the files can be copied
+ $directories = array(
+ $phpbb_root_path . 'ext/error/class/',
+ $phpbb_root_path . 'ext/error/classtype/',
+ $phpbb_root_path . 'ext/error/disabled/',
+ $phpbb_root_path . 'ext/foo/bar/',
+ $phpbb_root_path . 'ext/foo/bar/styles/prosilver/template/',
+ $phpbb_root_path . 'ext/foobar/',
+ $phpbb_root_path . 'ext/foobar/styles/prosilver/template/',
+ );
+
+ foreach ($directories as $dir)
+ {
+ if (!is_dir($dir))
+ {
+ mkdir($dir, 0777, true);
+ }
+ }
+
+ $fixtures = array(
+ 'error/class/controller.php',
+ 'error/class/ext.php',
+ 'error/classtype/controller.php',
+ 'error/classtype/ext.php',
+ 'error/disabled/controller.php',
+ 'error/disabled/ext.php',
+ 'foo/bar/controller.php',
+ 'foo/bar/ext.php',
+ 'foo/bar/styles/prosilver/template/foobar_body.html',
+ 'foobar/controller.php',
+ 'foobar/ext.php',
+ 'foobar/styles/prosilver/template/foobar_body.html',
+ );
+
+ foreach ($fixtures as $fixture)
+ {
+ if (!copy("tests/functional/fixtures/ext/$fixture", "{$phpbb_root_path}ext/$fixture"))
+ {
+ echo 'Could not copy file ' . $fixture;
+ }
+ }
+ }
+
+ public static function tearDownAfterClass()
+ {
+ $phpbb_root_path = self::$config['phpbb_functional_path'];
+
+ // @todo delete the fixtures from the $phpbb_root_path board
+ // Note that it might be best to find a public domain function
+ // and port it into here instead of writing it from scratch
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+ }
+
+ /**
+ * Check an extension at ./ext/foobar/ which should have the class
+ * phpbb_ext_foobar_controller
+ */
+ public function test_foobar()
+ {
+ $this->phpbb_extension_manager->enable('foobar');
+ $crawler = $this->request('GET', 'index.php?ext=foobar');
+ $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text());
+ $this->phpbb_extension_manager->purge('foobar');
+ }
+
+ /**
+ * Check an extension at ./ext/foo/bar/ which should have the class
+ * phpbb_ext_foo_bar_controller
+ */
+ public function test_foo_bar()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = $this->request('GET', 'index.php?ext=foo/bar');
+ $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text());
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/class which has class
+ * phpbb_ext_foobar_controller
+ */
+ public function test_error_class_name()
+ {
+ $this->phpbb_extension_manager->enable('error/class');
+ $crawler = $this->request('GET', 'index.php?ext=error/class');
+ $this->assertContains("The extension error/class is missing a controller class and cannot be accessed through the front-end.", $crawler->filter('#message')->text());
+ $this->phpbb_extension_manager->purge('error/class');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/classtype which has class
+ * phpbb_ext_error_classtype_controller but does not implement phpbb_extension_controller_interface
+ */
+ public function test_error_class_type()
+ {
+ $this->phpbb_extension_manager->enable('error/classtype');
+ $crawler = $this->request('GET', 'index.php?ext=error/classtype');
+ $this->assertContains("The extension controller class phpbb_ext_error_classtype_controller is not an instance of the phpbb_extension_controller_interface.", $crawler->filter('#message')->text());
+ $this->phpbb_extension_manager->purge('error/classtype');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/disabled that is (obviously)
+ * a disabled extension
+ */
+ public function test_error_ext_disabled()
+ {
+ $crawler = $this->request('GET', 'index.php?ext=error/disabled');
+ $this->assertContains("The extension error/disabled is not enabled", $crawler->filter('#message')->text());
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/404 that is (obviously)
+ * not existant
+ */
+ public function test_error_ext_missing()
+ {
+ $crawler = $this->request('GET', 'index.php?ext=error/404');
+ $this->assertContains("The extension error/404 does not exist.", $crawler->filter('#message')->text());
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/class/controller.php b/tests/functional/fixtures/ext/error/class/controller.php
new file mode 100644
index 0000000000..eb2ae362a6
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/class/controller.php
@@ -0,0 +1,17 @@
+<?php
+
+class phpbb_ext_foobar_controller implements phpbb_extension_controller_interface
+{
+ public function handle()
+ {
+ global $template;
+ $template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/class/');
+
+ $template->set_filenames(array(
+ 'body' => 'index_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/class/ext.php b/tests/functional/fixtures/ext/error/class/ext.php
new file mode 100644
index 0000000000..f97ad2b838
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/class/ext.php
@@ -0,0 +1,6 @@
+<?php
+
+class phpbb_ext_error_class_ext extends phpbb_extension_base
+{
+
+}
diff --git a/tests/functional/fixtures/ext/error/classtype/controller.php b/tests/functional/fixtures/ext/error/classtype/controller.php
new file mode 100644
index 0000000000..2276548b55
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/classtype/controller.php
@@ -0,0 +1,17 @@
+<?php
+
+class phpbb_ext_error_classtype_controller
+{
+ public function handle()
+ {
+ global $template;
+ $template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/classtype/');
+
+ $template->set_filenames(array(
+ 'body' => 'index_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/classtype/ext.php b/tests/functional/fixtures/ext/error/classtype/ext.php
new file mode 100644
index 0000000000..35b1cd15a2
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/classtype/ext.php
@@ -0,0 +1,6 @@
+<?php
+
+class phpbb_ext_error_classtype_ext extends phpbb_extension_base
+{
+
+}
diff --git a/tests/functional/fixtures/ext/error/disabled/controller.php b/tests/functional/fixtures/ext/error/disabled/controller.php
new file mode 100644
index 0000000000..b83a949020
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/disabled/controller.php
@@ -0,0 +1,17 @@
+<?php
+
+class phpbb_ext_error_disabled_controller implements phpbb_extension_controller_interface
+{
+ public function handle()
+ {
+ global $template;
+ $template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/disabled/');
+
+ $template->set_filenames(array(
+ 'body' => 'index_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/disabled/ext.php b/tests/functional/fixtures/ext/error/disabled/ext.php
new file mode 100644
index 0000000000..aec8051848
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/disabled/ext.php
@@ -0,0 +1,6 @@
+<?php
+
+class phpbb_ext_error_disabled_ext extends phpbb_extension_base
+{
+
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/controller.php b/tests/functional/fixtures/ext/foo/bar/controller.php
new file mode 100644
index 0000000000..24d218c412
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/controller.php
@@ -0,0 +1,17 @@
+<?php
+
+class phpbb_ext_foo_bar_controller implements phpbb_extension_controller_interface
+{
+ public function handle()
+ {
+ global $template;
+ $template->set_ext_dir_prefix($phpbb_root_path . 'ext/foo/bar/');
+
+ $template->set_filenames(array(
+ 'body' => 'foobar_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/ext.php b/tests/functional/fixtures/ext/foo/bar/ext.php
new file mode 100644
index 0000000000..3a2068631e
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/ext.php
@@ -0,0 +1,6 @@
+<?php
+
+class phpbb_ext_foo_bar_ext extends phpbb_extension_base
+{
+
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar_body.html b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar_body.html
new file mode 100644
index 0000000000..4addf2666f
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar_body.html
@@ -0,0 +1,5 @@
+<!-- INCLUDE overall_header.html -->
+
+<div id="welcome">This is for testing purposes.</div>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/tests/functional/fixtures/ext/foobar/controller.php b/tests/functional/fixtures/ext/foobar/controller.php
new file mode 100644
index 0000000000..bf8d8139ae
--- /dev/null
+++ b/tests/functional/fixtures/ext/foobar/controller.php
@@ -0,0 +1,17 @@
+<?php
+
+class phpbb_ext_foobar_controller implements phpbb_extension_controller_interface
+{
+ public function handle()
+ {
+ global $template;
+ $template->set_ext_dir_prefix($phpbb_root_path . 'ext/foobar/');
+
+ $template->set_filenames(array(
+ 'body' => 'foobar_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/foobar/ext.php b/tests/functional/fixtures/ext/foobar/ext.php
new file mode 100644
index 0000000000..7cf443d369
--- /dev/null
+++ b/tests/functional/fixtures/ext/foobar/ext.php
@@ -0,0 +1,6 @@
+<?php
+
+class phpbb_ext_foobar_ext extends phpbb_extension_base
+{
+
+}
diff --git a/tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html b/tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html
new file mode 100644
index 0000000000..4addf2666f
--- /dev/null
+++ b/tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html
@@ -0,0 +1,5 @@
+<!-- INCLUDE overall_header.html -->
+
+<div id="welcome">This is for testing purposes.</div>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index b5e6f7e377..69c62af297 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -14,6 +14,10 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $client;
protected $root_url;
+ protected $cache = null;
+ protected $db = null;
+ protected $extension_manager = null;
+
static protected $config = array();
static protected $already_installed = false;
@@ -66,6 +70,60 @@ class phpbb_functional_test_case extends phpbb_test_case
}
}
+ protected function get_db()
+ {
+ global $phpbb_root_path, $phpEx;
+ // so we don't reopen an open connection
+ if (!($this->db instanceof dbal))
+ {
+ if (!class_exists('dbal_' . self::$config['dbms']))
+ {
+ include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
+ }
+ $sql_db = 'dbal_' . self::$config['dbms'];
+ $this->db = new $sql_db();
+ $this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
+ }
+ return $this->db;
+ }
+
+ protected function get_cache_driver()
+ {
+ if (!$this->cache)
+ {
+ $this->cache = new phpbb_cache_driver_file;
+ }
+
+ return $this->cache;
+ }
+
+ protected function purge_cache()
+ {
+ $cache = $this->get_cache_driver();
+
+ $cache->purge();
+ $cache->unload();
+ $cache->load();
+ }
+
+ protected function get_extension_manager()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ if (!$this->extension_manager)
+ {
+ $this->extension_manager = new phpbb_extension_manager(
+ $this->get_db(),
+ self::$config['table_prefix'] . 'ext',
+ $phpbb_root_path,
+ ".$phpEx",
+ $this->get_cache_driver()
+ );
+ }
+
+ return $this->extension_manager;
+ }
+
protected function install_board()
{
global $phpbb_root_path, $phpEx;
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
new file mode 100644
index 0000000000..36845a7f71
--- /dev/null
+++ b/travis/phpunit-mysql-travis.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <server name="PHPBB_TEST_DBMS" value="mysqli" />
+ <server name="PHPBB_TEST_DBHOST" value="0.0.0.0" />
+ <server name="PHPBB_TEST_DBPORT" value="3306" />
+ <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
+ <server name="PHPBB_TEST_DBUSER" value="root" />
+ <server name="PHPBB_TEST_DBPASSWD" value="" />
+ <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ </php>
+</phpunit>
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
new file mode 100644
index 0000000000..461a53bcb1
--- /dev/null
+++ b/travis/phpunit-postgres-travis.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <!-- "Real" test database -->
+ <!-- uncomment, otherwise sqlite memory runs -->
+ <server name="PHPBB_TEST_DBMS" value="postgres"/>
+ <server name="PHPBB_TEST_DBHOST" value="localhost" />
+ <server name="PHPBB_TEST_DBPORT" value="5432" />
+ <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
+ <server name="PHPBB_TEST_DBUSER" value="postgres" />
+ <server name="PHPBB_TEST_DBPASSWD" value="" />
+ <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ </php>
+</phpunit>