aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/acp_attachments.html22
-rw-r--r--phpBB/adm/style/acp_logs.html10
-rw-r--r--phpBB/adm/style/acp_users.html10
-rw-r--r--phpBB/adm/style/admin.css5
-rw-r--r--phpBB/adm/style/simple_footer.html1
-rw-r--r--phpBB/adm/style/simple_header.html1
-rw-r--r--phpBB/assets/javascript/core.js72
-rwxr-xr-xphpBB/bin/phpbbcli.php1
-rw-r--r--phpBB/config/console.yml11
-rw-r--r--phpBB/config/services.yml15
-rw-r--r--phpBB/docs/events.md8
-rw-r--r--phpBB/feed.php4
-rw-r--r--phpBB/includes/acp/acp_attachments.php2
-rw-r--r--phpBB/includes/functions.php4
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/functions_url_matcher.php22
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php15
-rw-r--r--phpBB/install/database_update.php10
-rw-r--r--phpBB/language/en/common.php9
-rw-r--r--phpBB/phpbb/console/command/cache/purge.php62
-rw-r--r--phpBB/phpbb/controller/helper.php6
-rw-r--r--phpBB/phpbb/controller/provider.php26
-rw-r--r--phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php33
-rw-r--r--phpBB/phpbb/event/kernel_request_subscriber.php15
-rw-r--r--phpBB/phpbb/feed/forum.php1
-rw-r--r--phpBB/phpbb/feed/news.php7
-rw-r--r--phpBB/phpbb/feed/post_base.php3
-rw-r--r--phpBB/phpbb/feed/topic.php7
-rw-r--r--phpBB/phpbb/feed/topic_base.php21
-rw-r--r--phpBB/phpbb/feed/topics.php7
-rw-r--r--phpBB/phpbb/feed/topics_active.php7
-rw-r--r--phpBB/phpbb/user.php10
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html8
-rw-r--r--phpBB/styles/prosilver/template/posting_attach_body.html4
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_attachments.html2
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html9
-rw-r--r--phpBB/styles/prosilver/theme/colours.css4
-rw-r--r--phpBB/styles/prosilver/theme/content.css27
-rw-r--r--phpBB/styles/prosilver/theme/plupload.css5
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css5
-rw-r--r--phpBB/styles/subsilver2/template/simple_header.html5
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html5
-rw-r--r--phpBB/viewtopic.php2
-rw-r--r--tests/avatar/manager_test.php20
-rw-r--r--tests/bbcode/parser_test.php2
-rw-r--r--tests/cache/null_driver_test.php6
-rw-r--r--tests/class_loader/class_loader_test.php2
-rw-r--r--tests/controller/controller_test.php3
-rw-r--r--tests/controller/helper_route_test.php28
-rw-r--r--tests/cron/manager_test.php2
-rw-r--r--tests/functional/feed_test.php52
-rw-r--r--tests/functional/ucp_allow_pm_test.php70
-rw-r--r--tests/functional/visibility_softdelete_test.php2
-rw-r--r--tests/functions/build_url_test.php5
-rw-r--r--tests/mock/controller_helper.php22
-rw-r--r--tests/pagination/pagination_test.php8
-rw-r--r--tests/passwords/drivers_test.php2
-rw-r--r--tests/passwords/manager_test.php6
59 files changed, 553 insertions, 188 deletions
diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html
index 5d35666fdd..0e3b5ff3b2 100644
--- a/phpBB/adm/style/acp_attachments.html
+++ b/phpBB/adm/style/acp_attachments.html
@@ -331,15 +331,15 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <table class="table1 zebra-table">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
<th>{L_FILENAME}</th>
- <th>{L_FILEDATE}</th>
- <th>{L_FILESIZE}</th>
- <th>{L_ATTACH_POST_ID}</th>
- <th>{L_ATTACH_TO_POST}</th>
- <th>{L_DELETE}</th>
+ <th style="width: 15%;">{L_FILEDATE}</th>
+ <th style="width: 15%;">{L_FILESIZE}</th>
+ <th style="width: 15%;">{L_ATTACH_POST_ID}</th>
+ <th style="width: 15%;">{L_ATTACH_TO_POST}</th>
+ <th style="width: 15%;">{L_DELETE}</th>
</tr>
</thead>
<tbody>
@@ -348,7 +348,7 @@
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
<td>{orphan.FILETIME}</td>
<td>{orphan.FILESIZE}</td>
- <td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td>
+ <td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" name="post_id[{orphan.ATTACH_ID}]" maxlength="10" value="{orphan.POST_ID}" style="width: 75%;" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
</tr>
@@ -390,13 +390,13 @@
</div>
<!-- IF .attachments -->
- <table class="table1 zebra-table">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
<th>{L_FILENAME}</th>
- <th>{L_POSTED}</th>
- <th class="centered-text">{L_FILESIZE}</th>
- <th class="centered-text">{L_MARK}</th>
+ <th style="width: 15%;">{L_POSTED}</th>
+ <th style="width: 15%;" class="centered-text">{L_FILESIZE}</th>
+ <th style="width: 10%;" class="centered-text">{L_MARK}</th>
</tr>
</thead>
<tbody>
diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html
index 9343b9b509..ec2065f906 100644
--- a/phpBB/adm/style/acp_logs.html
+++ b/phpBB/adm/style/acp_logs.html
@@ -22,15 +22,15 @@
<div><br style="clear: both;" /></div>
<!-- IF .log -->
- <table class="table1 zebra-table">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
- <th>{L_USERNAME}</th>
- <th>{L_IP}</th>
- <th>{L_TIME}</th>
+ <th style="width: 15%;">{L_USERNAME}</th>
+ <th style="width: 15%;">{L_IP}</th>
+ <th style="width: 20%;">{L_TIME}</th>
<th>{L_ACTION}</th>
<!-- IF S_CLEARLOGS -->
- <th>{L_MARK}</th>
+ <th style="width: 50px;">{L_MARK}</th>
<!-- ENDIF -->
</tr>
</thead>
diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html
index b84e32013f..25064c6f3a 100644
--- a/phpBB/adm/style/acp_users.html
+++ b/phpBB/adm/style/acp_users.html
@@ -164,14 +164,14 @@
</div>
<!-- IF .attach -->
- <table class="table1 zebra-table">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
<th>{L_FILENAME}</th>
- <th>{L_POST_TIME}</th>
- <th>{L_FILESIZE}</th>
- <th>{L_DOWNLOADS}</th>
- <th>{L_MARK}</th>
+ <th style="width: 20%;">{L_POST_TIME}</th>
+ <th style="width: 20%;">{L_FILESIZE}</th>
+ <th style="width: 20%;">{L_DOWNLOADS}</th>
+ <th style="width: 50px;">{L_MARK}</th>
</tr>
</thead>
<tbody>
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 6f2d65afc0..60a5cd9472 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -911,6 +911,11 @@ table.styles td.users, table td.mark {
text-align: center;
}
+table.fixed-width-table {
+ table-layout: fixed;
+ word-break: break-word;
+}
+
@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
{
table.responsive, table.responsive tbody, table.responsive tr, table.responsive td {
diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html
index c549a2df4e..d3f2f17bc7 100644
--- a/phpBB/adm/style/simple_footer.html
+++ b/phpBB/adm/style/simple_footer.html
@@ -21,6 +21,7 @@
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
<!-- EVENT acp_simple_footer_after -->
+{$SCRIPTS}
</body>
</html>
diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html
index ae25f28d32..bf8f41cd7a 100644
--- a/phpBB/adm/style/simple_header.html
+++ b/phpBB/adm/style/simple_header.html
@@ -83,6 +83,7 @@ function find_username(url)
// ]]>
</script>
<!-- EVENT acp_simple_header_head_append -->
+{$STYLESHEETS}
</head>
<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index f461d5a175..ae8583ddbf 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -694,6 +694,74 @@ $('#phpbb').click(function(e) {
}
});
+phpbb.history = {};
+
+/**
+* Check whether a method in the native history object is supported.
+*
+* @param string fn Method name.
+* @return bool Returns true if the method is supported.
+*/
+phpbb.history.isSupported = function(fn) {
+ if (typeof history === 'undefined' || typeof history[fn] === 'undefined') {
+ return false;
+ }
+ return true;
+};
+
+/**
+* Wrapper for the pushState and replaceState methods of the
+* native history object.
+*
+* @param string mode Mode. Either push or replace.
+* @param string url New URL.
+* @param string title Optional page title.
+* @patam object obj Optional state object.
+*
+* @return undefined
+*/
+phpbb.history.alterUrl = function(mode, url, title, obj) {
+ var fn = mode + 'State';
+
+ if (!url || !phpbb.history.isSupported(fn)) {
+ return;
+ }
+ if (!title) {
+ title = document.title;
+ }
+ if (!obj) {
+ obj = null;
+ }
+
+ history[fn](obj, title, url);
+};
+
+/**
+* Wrapper for the native history.replaceState method.
+*
+* @param string url New URL.
+* @param string title Optional page title.
+* @patam object obj Optional state object.
+*
+* @return undefined
+*/
+phpbb.history.replaceUrl = function(url, title, obj) {
+ phpbb.history.alterUrl('replace', url, title, obj);
+};
+
+/**
+* Wrapper for the native history.pushState method.
+*
+* @param string url New URL.
+* @param string title Optional page title.
+* @patam object obj Optional state object.
+*
+* @return undefined
+*/
+phpbb.history.pushUrl = function(url, title, obj) {
+ phpbb.history.alterUrl('push', url, title, obj);
+};
+
/**
* Hide the optgroups that are not the selected timezone
*
@@ -1444,6 +1512,10 @@ $(document).ready(function() {
$('#color_palette_placeholder').each(function() {
phpbb.registerPalette($(this));
});
+
+ // Update browser history URL to point to specific post in viewtopic.php
+ // when using view=unread#unread link.
+ phpbb.history.replaceUrl($('#unread[data-url]').data('url'));
});
})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php
index 02d6b88943..dd5c8fa774 100755
--- a/phpBB/bin/phpbbcli.php
+++ b/phpBB/bin/phpbbcli.php
@@ -21,6 +21,7 @@ require($phpbb_root_path . 'includes/startup.' . $phpEx);
require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
index 3d57c257dd..1340d9c0d7 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/console.yml
@@ -1,4 +1,15 @@
services:
+ console.command.cache.purge:
+ class: phpbb\console\command\cache\purge
+ arguments:
+ - @cache.driver
+ - @dbal.conn
+ - @auth
+ - @log
+ - @user
+ tags:
+ - { name: console.command }
+
console.command.config.delete:
class: phpbb\console\command\config\delete
arguments:
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index 90a2f3b187..fdd8a33135 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -95,6 +95,7 @@ services:
- @user
- @config
- @controller.provider
+ - @ext.manager
- %core.root_path%
- %core.php_ext%
@@ -107,8 +108,6 @@ services:
controller.provider:
class: phpbb\controller\provider
- arguments:
- - @ext.finder
calls:
- [find, [%core.root_path%]]
@@ -175,16 +174,6 @@ services:
- %core.php_ext%
- @cache.driver
- ext.finder:
- class: phpbb\extension\finder
- arguments:
- - @ext.manager
- - @filesystem
- - %core.root_path%
- - @cache.driver
- - %core.php_ext%
- - _ext_finder
-
filesystem:
class: phpbb\filesystem
@@ -217,7 +206,7 @@ services:
kernel_request_subscriber:
class: phpbb\event\kernel_request_subscriber
arguments:
- - @ext.finder
+ - @ext.manager
- %core.root_path%
- %core.php_ext%
tags:
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 18beb1c64a..66b558a665 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -617,6 +617,14 @@ simple_header_body_before
* Since: 3.1.0-b2
* Purpose: Add content to the header body
+simple_header_head_append
+===
+* Locations:
+ + styles/prosilver/template/simple_header.html
+ + styles/subsilver2/template/simple_header.html
+* Since: 3.1.0-b4
+* Purpose: Add asset calls directly before the `</head>` tag
+
topiclist_row_prepend
===
* Locations:
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 0c4cc32fdb..db0ed5364e 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -100,6 +100,8 @@ while ($row = $feed->get_item())
$published = ($feed->get('published') !== NULL) ? (int) $row[$feed->get('published')] : 0;
$updated = ($feed->get('updated') !== NULL) ? (int) $row[$feed->get('updated')] : 0;
+ $display_attachments = ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && isset($row['post_attachment']) && $row['post_attachment']) ? true : false;
+
$item_row = array(
'author' => ($feed->get('creator') !== NULL) ? $row[$feed->get('creator')] : '',
'published' => ($published > 0) ? $phpbb_feed_helper->format_date($published) : '',
@@ -108,7 +110,7 @@ while ($row = $feed->get_item())
'title' => censor_text($title),
'category' => ($config['feed_item_statistics'] && !empty($row['forum_id'])) ? $board_url . '/viewforum.' . $phpEx . '?f=' . $row['forum_id'] : '',
'category_name' => ($config['feed_item_statistics'] && isset($row['forum_name'])) ? $row['forum_name'] : '',
- 'description' => censor_text($phpbb_feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ((isset($row['post_attachment']) && $row['post_attachment']) ? $feed->get_attachments($row['post_id']) : array()))),
+ 'description' => censor_text($phpbb_feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ($display_attachments ? $feed->get_attachments($row['post_id']) : array()))),
'statistics' => '',
);
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 1aaf1f9c09..03d3e0f85f 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1222,7 +1222,7 @@ class acp_attachments
'ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']),
'FILESIZE' => get_formatted_filesize((int) $row['filesize']),
'FILETIME' => $user->format_date((int) $row['filetime']),
- 'REAL_FILENAME' => (!$row['in_message']) ? utf8_wordwrap(utf8_basename((string) $row['real_filename']), 40, '<br />', true) : '',
+ 'REAL_FILENAME' => (!$row['in_message']) ? utf8_basename((string) $row['real_filename']) : '',
'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']),
'EXT_GROUP_NAME' => (!empty($extensions[$row['extension']]['group_name'])) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '',
'COMMENT' => $comment,
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 3480a338c0..a0e2a46f54 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2356,6 +2356,10 @@ function build_url($strip_vars = false)
{
$redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false);
}
+ else
+ {
+ $redirect = str_replace('&', '&amp;', $redirect);
+ }
return $redirect . ((strpos($redirect, '?') === false) ? '?' : '');
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 547ea69e81..cc46799252 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
function generate_smilies($mode, $forum_id)
{
global $db, $user, $config, $template, $phpbb_dispatcher;
- global $phpEx, $phpbb_root_path, $phpbb_container;
+ global $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_path_helper;
$base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id);
$pagination = $phpbb_container->get('pagination');
@@ -111,7 +111,7 @@ function generate_smilies($mode, $forum_id)
if (sizeof($smilies))
{
- $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path();
foreach ($smilies as $row)
{
diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php
index 8e5ae20f93..cdbe60595c 100644
--- a/phpBB/includes/functions_url_matcher.php
+++ b/phpBB/includes/functions_url_matcher.php
@@ -22,22 +22,22 @@ if (!defined('IN_PHPBB'))
/**
* Create a new UrlMatcher class and dump it into the cache file
*
-* @param \phpbb\extension\finder $finder Extension finder
+* @param \phpbb\extension\manager $manager Extension manager
* @param RequestContext $context Symfony RequestContext object
* @param string $root_path Root path
* @param string $php_ext PHP extension
* @return null
*/
-function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $context, $root_path, $php_ext)
+function phpbb_get_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path, $php_ext)
{
if (defined('DEBUG'))
{
- return phpbb_create_url_matcher($finder, $context, $root_path);
+ return phpbb_create_url_matcher($manager, $context, $root_path);
}
if (!phpbb_url_matcher_dumped($root_path, $php_ext))
{
- phpbb_create_dumped_url_matcher($finder, $root_path, $php_ext);
+ phpbb_create_dumped_url_matcher($manager, $root_path, $php_ext);
}
return phpbb_load_url_matcher($context, $root_path, $php_ext);
@@ -46,14 +46,15 @@ function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $
/**
* Create a new UrlMatcher class and dump it into the cache file
*
-* @param \phpbb\extension\finder $finder Extension finder
+* @param \phpbb\extension\manager $manager Extension manager
* @param string $root_path Root path
* @param string $php_ext PHP extension
* @return null
*/
-function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_path, $php_ext)
+function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
{
- $provider = new \phpbb\controller\provider($finder);
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($manager->get_finder());
$routes = $provider->find($root_path)->get_routes();
$dumper = new PhpMatcherDumper($routes);
$cached_url_matcher_dump = $dumper->dump(array(
@@ -66,13 +67,14 @@ function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_
/**
* Create a non-cached UrlMatcher
*
-* @param \phpbb\extension\finder $finder Extension finder
+* @param \phpbb\extension\manager $manager Extension manager
* @param RequestContext $context Symfony RequestContext object
* @return UrlMatcher
*/
-function phpbb_create_url_matcher(\phpbb\extension\finder $finder, RequestContext $context, $root_path)
+function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
{
- $provider = new \phpbb\controller\provider($finder);
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($manager->get_finder());
$routes = $provider->find($root_path)->get_routes();
return new UrlMatcher($routes, $context);
}
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 3219771c93..16b3ca8573 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -1226,6 +1226,8 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
// Check for disallowed recipients
if (!empty($address_list['u']))
{
+ $can_ignore_allow_pm = $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_');
+
// Administrator deactivated users check and we need to check their
// PM status (do they want to receive PM's?)
// Only check PM status if not a moderator or admin, since they
@@ -1233,14 +1235,11 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
$sql = 'SELECT user_id, user_allow_pm
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . '
- AND (user_type = ' . USER_INACTIVE . '
- AND user_inactive_reason = ' . INACTIVE_MANUAL . ')';
-
- $can_ignore_allow_pm = ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'));
- if (!$can_ignore_allow_pm)
- {
- $sql .= ' OR user_allow_pm = 0';
- }
+ AND (
+ (user_type = ' . USER_INACTIVE . '
+ AND user_inactive_reason = ' . INACTIVE_MANUAL . ')
+ ' . ($can_ignore_allow_pm ? '' : ' OR user_allow_pm = 0') . '
+ )';
$result = $db->sql_query($sql);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 6c9eeb6a75..b1bfbc1839 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -115,7 +115,13 @@ request_var('', 0, false, false, $request); // "dependency injection" for a func
$config = $phpbb_container->get('config');
set_config(null, null, null, $config);
set_config_count(null, null, null, $config);
-$orig_version = $config['version'];
+
+if (!isset($config['version_update_from']))
+{
+ $config->set('version_update_from', $config['version']);
+}
+
+$orig_version = $config['version_update_from'];
$user->add_lang(array('common', 'acp/common', 'install', 'migrator'));
@@ -287,4 +293,6 @@ else
echo $user->lang['COMPLETE_LOGIN_TO_BOARD'];
}
+$config->delete('version_update_from');
+
phpbb_end_update($cache, $config);
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index aac4f2516e..7faa46daf3 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -555,7 +555,8 @@ $lang = array_merge($lang, array(
'POST_BY_FOE' => '<strong>%1$s</strong>, who is currently on your ignore list, made this post.',
'POST_DISPLAY' => '%1$sDisplay this post%2$s.',
'POST_DAY' => '%.2f posts per day',
- 'POST_DELETED' => 'Deleted post:',
+ 'POST_DELETED_ACTION' => 'Deleted post:',
+ 'POST_DELETED' => 'This post has been deleted.',
'POST_DELETED_BY' => '<strong>%2$s</strong> deleted the post by <strong>%1$s</strong> on %3$s.',
'POST_DELETED_BY_REASON'=> '<strong>%2$s</strong> deleted the post by <strong>%1$s</strong> on %3$s for the following reason: %4$s',
'POST_DETAILS' => 'Post details',
@@ -568,7 +569,8 @@ $lang = array_merge($lang, array(
'POST_SUBJECT' => 'Post subject',
'POST_TIME' => 'Post time',
'POST_TOPIC' => 'Post a new topic',
- 'POST_UNAPPROVED' => 'Post awaiting approval:',
+ 'POST_UNAPPROVED_ACTION' => 'Post awaiting approval:',
+ 'POST_UNAPPROVED' => 'This post has not been approved.',
'POWERED_BY' => 'Powered by %s',
'PREVIEW' => 'Preview',
'PREVIOUS' => 'Previous', // Used in pagination
@@ -738,7 +740,8 @@ $lang = array_merge($lang, array(
'TOPIC_MOVED' => 'Moved topic',
'TOPIC_REVIEW' => 'Topic review',
'TOPIC_TITLE' => 'Topic title',
- 'TOPIC_UNAPPROVED' => 'This topic has not been approved',
+ 'TOPIC_UNAPPROVED' => 'This topic has not been approved.',
+ 'TOPIC_DELETED' => 'This topic has been deleted.',
'TOTAL_ATTACHMENTS' => 'Attachment(s)',
'TOTAL_LOGS' => array(
1 => '%d log',
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php
new file mode 100644
index 0000000000..017bdc5144
--- /dev/null
+++ b/phpBB/phpbb/console/command/cache/purge.php
@@ -0,0 +1,62 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+namespace phpbb\console\command\cache;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class purge extends \phpbb\console\command\command
+{
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+
+ /** @var \phpbb\log\log */
+ protected $log;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user)
+ {
+ $this->cache = $cache;
+ $this->db = $db;
+ $this->auth = $auth;
+ $this->log = $log;
+ $this->user = $user;
+ $this->user->add_lang(array('acp/common'));
+ parent::__construct();
+ }
+
+ protected function configure()
+ {
+ $this
+ ->setName('cache:purge')
+ ->setDescription('Purge the cache.')
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->cache->purge();
+
+ // Clear permissions
+ $this->auth->acl_clear_prefetch();
+ phpbb_cache_moderators($this->db, $this->cache, $this->auth);
+
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array());
+
+ $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS'));
+ }
+}
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 54c30c93fc..959a24f277 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -56,17 +56,19 @@ class helper
* @param \phpbb\user $user User object
* @param \phpbb\config\config $config Config object
* @param \phpbb\controller\provider $provider Path provider
+ * @param \phpbb\extension\manager $manager Extension manager object
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP extension
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
- $this->route_collection = $provider->get_routes();
+ $provider->find_routing_files($manager->get_finder());
+ $this->route_collection = $provider->find($phpbb_root_path)->get_routes();
}
/**
diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php
index 2c7493f64c..a32ce1473b 100644
--- a/phpBB/phpbb/controller/provider.php
+++ b/phpBB/phpbb/controller/provider.php
@@ -37,20 +37,24 @@ class provider
* @param array() $routing_files Array of strings containing paths
* to YAML files holding route information
*/
- public function __construct(\phpbb\extension\finder $finder = null, $routing_files = array())
+ public function __construct($routing_files = array())
{
$this->routing_files = $routing_files;
+ }
- if ($finder)
- {
- // We hardcode the path to the core config directory
- // because the finder cannot find it
- $this->routing_files = array_merge($this->routing_files, array('config/routing.yml'), array_keys($finder
- ->directory('/config')
- ->suffix('routing.yml')
- ->find()
- ));
- }
+ /**
+ * @param \phpbb\extension\finder $finder
+ * @return null
+ */
+ public function find_routing_files(\phpbb\extension\finder $finder)
+ {
+ // We hardcode the path to the core config directory
+ // because the finder cannot find it
+ $this->routing_files = array_merge($this->routing_files, array('config/routing.yml'), array_keys($finder
+ ->directory('/config')
+ ->suffix('routing.yml')
+ ->find()
+ ));
}
/**
diff --git a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
new file mode 100644
index 0000000000..8fa6a3ff5b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+/**
+* Class captcha_plugin
+*
+* Reset the captcha setting to the default plugin if the defined 'captcha_plugin' is missing.
+*/
+class reset_missing_captcha_plugin extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ (!is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)),
+ array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/event/kernel_request_subscriber.php b/phpBB/phpbb/event/kernel_request_subscriber.php
index 7d5418498b..a39d622273 100644
--- a/phpBB/phpbb/event/kernel_request_subscriber.php
+++ b/phpBB/phpbb/event/kernel_request_subscriber.php
@@ -18,10 +18,10 @@ use Symfony\Component\Routing\RequestContext;
class kernel_request_subscriber implements EventSubscriberInterface
{
/**
- * Extension finder object
- * @var \phpbb\extension\finder
+ * Extension manager object
+ * @var \phpbb\extension\manager
*/
- protected $finder;
+ protected $manager;
/**
* PHP extension
@@ -38,15 +38,15 @@ class kernel_request_subscriber implements EventSubscriberInterface
/**
* Construct method
*
- * @param \phpbb\extension\finder $finder Extension finder object
+ * @param \phpbb\extension\manager $manager Extension manager object
* @param string $root_path Root path
* @param string $php_ext PHP extension
*/
- public function __construct(\phpbb\extension\finder $finder, $root_path, $php_ext)
+ public function __construct(\phpbb\extension\manager $manager, $root_path, $php_ext)
{
- $this->finder = $finder;
$this->root_path = $root_path;
$this->php_ext = $php_ext;
+ $this->manager = $manager;
}
/**
@@ -55,6 +55,7 @@ class kernel_request_subscriber implements EventSubscriberInterface
* This is responsible for setting up the routing information
*
* @param GetResponseEvent $event
+ * @throws \BadMethodCallException
* @return null
*/
public function on_kernel_request(GetResponseEvent $event)
@@ -63,7 +64,7 @@ class kernel_request_subscriber implements EventSubscriberInterface
$context = new RequestContext();
$context->fromRequest($request);
- $matcher = phpbb_get_url_matcher($this->finder, $context, $this->root_path, $this->php_ext);
+ $matcher = phpbb_get_url_matcher($this->manager, $context, $this->root_path, $this->php_ext);
$router_listener = new RouterListener($matcher, $context);
$router_listener->onKernelRequest($event);
}
diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php
index 8e6490923d..e35ec4baa4 100644
--- a/phpBB/phpbb/feed/forum.php
+++ b/phpBB/phpbb/feed/forum.php
@@ -132,6 +132,7 @@ class forum extends \phpbb\feed\post_base
parent::adjust_item($item_row, $row);
$item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
+ $item_row['forum_id'] = $this->forum_id;
}
function get_item()
diff --git a/phpBB/phpbb/feed/news.php b/phpBB/phpbb/feed/news.php
index 1b7c452a92..2242525db6 100644
--- a/phpBB/phpbb/feed/news.php
+++ b/phpBB/phpbb/feed/news.php
@@ -64,9 +64,8 @@ class news extends \phpbb\feed\topic_base
// We really have to get the post ids first!
$sql = 'SELECT topic_first_post_id, topic_time
FROM ' . TOPICS_TABLE . '
- WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . '
- AND topic_moved_id = 0
- AND topic_visibility = ' . ITEM_APPROVED . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
ORDER BY topic_time DESC';
$result = $this->db->sql_query_limit($sql, $this->num_items);
@@ -85,7 +84,7 @@ class news extends \phpbb\feed\topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
- p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment',
+ p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
'FROM' => array(
TOPICS_TABLE => 't',
POSTS_TABLE => 'p',
diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php
index de98f446f3..cfcd8671a3 100644
--- a/phpBB/phpbb/feed/post_base.php
+++ b/phpBB/phpbb/feed/post_base.php
@@ -46,7 +46,8 @@ abstract class post_base extends \phpbb\feed\attachments_base
{
$item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
. ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')])
- . (($this->is_moderator_approve_forum($row['forum_id']) && $row['post_visibility'] !== ITEM_APPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '');
+ . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '')
+ . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : '');
}
}
}
diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php
index fb49aa65cc..10b0f4f645 100644
--- a/phpBB/phpbb/feed/topic.php
+++ b/phpBB/phpbb/feed/topic.php
@@ -105,6 +105,13 @@ class topic extends \phpbb\feed\post_base
return true;
}
+ function adjust_item(&$item_row, &$row)
+ {
+ parent::adjust_item($item_row, $row);
+
+ $item_row['forum_id'] = $this->forum_id;
+ }
+
function get_item()
{
return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row;
diff --git a/phpBB/phpbb/feed/topic_base.php b/phpBB/phpbb/feed/topic_base.php
index e8639a6fa6..d25bd0b50f 100644
--- a/phpBB/phpbb/feed/topic_base.php
+++ b/phpBB/phpbb/feed/topic_base.php
@@ -45,9 +45,24 @@ abstract class topic_base extends \phpbb\feed\attachments_base
{
$item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
. ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')])
- . ' ' . $this->separator_stats . ' ' . $this->user->lang['REPLIES'] . ' ' . $this->content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1
- . ' ' . $this->separator_stats . ' ' . $this->user->lang['VIEWS'] . ' ' . $row['topic_views']
- . (($this->is_moderator_approve_forum($row['forum_id']) && $row['topic_posts_unapproved']) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POSTS_UNAPPROVED'] : '');
+ . ' ' . $this->separator_stats . ' ' . $this->user->lang['REPLIES'] . ' ' . ($this->content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1)
+ . ' ' . $this->separator_stats . ' ' . $this->user->lang['VIEWS'] . ' ' . $row['topic_views'];
+
+ if ($this->is_moderator_approve_forum($row['forum_id']))
+ {
+ if ( (int)$row['topic_visibility'] === ITEM_DELETED)
+ {
+ $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_DELETED'];
+ }
+ else if ((int)$row['topic_visibility'] === ITEM_UNAPPROVED)
+ {
+ $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_UNAPPROVED'];
+ }
+ else if ($row['topic_posts_unapproved'])
+ {
+ $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['POSTS_UNAPPROVED'];
+ }
+ }
}
}
}
diff --git a/phpBB/phpbb/feed/topics.php b/phpBB/phpbb/feed/topics.php
index e8b9f6de6c..b6d9ec7cc6 100644
--- a/phpBB/phpbb/feed/topics.php
+++ b/phpBB/phpbb/feed/topics.php
@@ -36,9 +36,8 @@ class topics extends \phpbb\feed\topic_base
// We really have to get the post ids first!
$sql = 'SELECT topic_first_post_id, topic_time
FROM ' . TOPICS_TABLE . '
- WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . '
- AND topic_moved_id = 0
- AND topic_visibility = ' . ITEM_APPROVED . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
ORDER BY topic_time DESC';
$result = $this->db->sql_query_limit($sql, $this->num_items);
@@ -57,7 +56,7 @@ class topics extends \phpbb\feed\topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
- p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment',
+ p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
'FROM' => array(
TOPICS_TABLE => 't',
POSTS_TABLE => 'p',
diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php
index 809a536c2a..c7234510fb 100644
--- a/phpBB/phpbb/feed/topics_active.php
+++ b/phpBB/phpbb/feed/topics_active.php
@@ -51,9 +51,8 @@ class topics_active extends \phpbb\feed\topic_base
// We really have to get the post ids first!
$sql = 'SELECT topic_last_post_id, topic_last_post_time
FROM ' . TOPICS_TABLE . '
- WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . '
- AND topic_moved_id = 0
- AND topic_visibility = ' . ITEM_APPROVED . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
' . $last_post_time_sql . '
ORDER BY topic_last_post_time DESC';
$result = $this->db->sql_query_limit($sql, $this->num_items);
@@ -74,7 +73,7 @@ class topics_active extends \phpbb\feed\topic_base
'SELECT' => 'f.forum_id, f.forum_name,
t.topic_id, t.topic_title, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views,
t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time,
- p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment',
+ p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
'FROM' => array(
TOPICS_TABLE => 't',
POSTS_TABLE => 'p',
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index f8e473dcad..591b5ca30d 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -795,8 +795,14 @@ class user extends \phpbb\session
*/
function img($img, $alt = '')
{
- $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt;
- return '<span class="imageset ' . $img . '">' . $alt . '</span>';
+ $title = '';
+
+ if ($alt)
+ {
+ $alt = $this->lang($alt);
+ $title = ' title="' . $alt . '"';
+ }
+ return '<span class="imageset ' . $img . '"' . $title . '>' . $alt . '</span>';
}
/**
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index dd5e27a10e..7623fbe38b 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -96,10 +96,10 @@
<!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF -->
<!-- ELSEIF S_SHOW_GROUP -->
<th class="name">{L_GROUP_MEMBERS}</th>
- <th class="posts">&nbsp;</th>
- <th class="info">&nbsp;</th>
- <th class="joined">&nbsp;</th>
- <!-- IF U_SORT_ACTIVE --><th class="active">&nbsp;</th><!-- ENDIF -->
+ <th class="posts">{L_POSTS}</th>
+ <th class="info"><!-- BEGIN custom_fields --><!-- IF not custom_fields.S_FIRST_ROW -->{L_COMMA_SEPARATOR} <!-- ENDIF -->{custom_fields.PROFILE_FIELD_NAME}<!-- END custom_fields --></th>
+ <th class="joined">{L_JOINED}</th>
+ <!-- IF U_SORT_ACTIVE --><th class="active">{L_LAST_ACTIVE}</th><!-- ENDIF -->
<!-- ENDIF -->
</tr>
</thead>
diff --git a/phpBB/styles/prosilver/template/posting_attach_body.html b/phpBB/styles/prosilver/template/posting_attach_body.html
index b6f4d13804..4ad66656b2 100644
--- a/phpBB/styles/prosilver/template/posting_attach_body.html
+++ b/phpBB/styles/prosilver/template/posting_attach_body.html
@@ -35,7 +35,7 @@
<tbody class="responsive-skip-empty" id="file-list">
<tr class="attach-row" id="attach-row-tpl">
<td class="attach-name">
- <span class="file-name"></span>
+ <span class="file-name ellipsis-text"></span>
<span class="attach-controls">
<input type="button" value="{L_PLACE_INLINE}" class="button2 hidden file-inline-bbcode" />&nbsp;
<input type="button" value="{L_DELETE_FILE}" class="button2 file-delete" />
@@ -58,7 +58,7 @@
<!-- BEGIN attach_row -->
<tr class="attach-row" data-attach-id="{attach_row.ATTACH_ID}">
<td class="attach-name">
- <span class="file-name"><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></span>
+ <span class="file-name ellipsis-text"><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></span>
<span class="attach-controls">
<!-- IF S_INLINE_ATTACHMENT_OPTIONS --><input type="button" value="{L_PLACE_INLINE}" class="button2 file-inline-bbcode" />&nbsp; <!-- ENDIF -->
<input type="submit" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" class="button2 file-delete" />
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index f5e265ac16..48f6cc87da 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -24,6 +24,10 @@
<!-- DEFINE $POPUP = 1 -->
+<!-- EVENT simple_header_head_append -->
+
+{$STYLESHEETS}
+
</head>
<body id="phpbb" class="nojs {S_CONTENT_DIRECTION} {BODY_CLASS}">
diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html
index ed39e80c12..4731683a80 100644
--- a/phpBB/styles/prosilver/template/ucp_attachments.html
+++ b/phpBB/styles/prosilver/template/ucp_attachments.html
@@ -38,7 +38,7 @@
<dl>
<dt>
<div class="list-inner">
- <a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br />
+ <a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle attachment-filename ellipsis-text" title="{attachrow.FILENAME}">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br />
<!-- IF attachrow.S_IN_MESSAGE -->{L_PM}{L_COLON} <!-- ELSE -->{L_TOPIC}{L_COLON} <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a>
</div>
</dt>
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index ed45835da6..17c73b82f4 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -115,8 +115,8 @@
<!-- BEGIN postrow -->
<!-- EVENT viewtopic_body_postrow_post_before -->
- <!-- IF postrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
- <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF -->">
+ <!-- IF postrow.S_FIRST_UNREAD --><a id="unread" data-url="{postrow.U_MINI_POST}"></a><!-- ENDIF -->
+ <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->">
<div class="inner">
<dl class="postprofile" id="profile{postrow.POST_ID}"<!-- IF postrow.S_POST_HIDDEN --> style="display: none;"<!-- ENDIF -->>
@@ -131,6 +131,7 @@
<!-- IF postrow.POSTER_POSTS != '' --><dd class="profile-posts"><strong>{L_POSTS}{L_COLON}</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->
<!-- IF postrow.POSTER_JOINED --><dd class="profile-joined"><strong>{L_JOINED}{L_COLON}</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->
+ <!-- IF postrow.POSTER_WARNINGS --><dd class="profile-warnings"><strong>{L_WARNINGS}{L_COLON}</strong> {postrow.POSTER_WARNINGS}</dd><!-- ENDIF -->
<!-- IF postrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
@@ -214,7 +215,7 @@
<!-- IF postrow.S_POST_UNAPPROVED -->
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
<p class="post-notice unapproved">
- <strong>{L_POST_UNAPPROVED}</strong>
+ <strong>{L_POST_UNAPPROVED_ACTION}</strong>
<input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" />
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
<input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
@@ -224,7 +225,7 @@
<!-- ELSEIF postrow.S_POST_DELETED -->
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
<p class="post-notice deleted">
- <strong>{L_POST_DELETED}</strong>
+ <strong>{L_POST_DELETED_ACTION}</strong>
<input class="button2" type="submit" value="{L_DELETE}" name="action[disapprove]" />
<input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
<input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 39f28b4774..f43dfcfcce 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -660,6 +660,10 @@ fieldset.polls dd div {
background-image: url("./en/icon_user_online.gif");
}
+dd.profile-warnings {
+ color: #BC2A4D;
+}
+
/*
--------------------------------------------------------------
Colours and backgrounds for buttons.css
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index dc6ab9aef3..b66c841d7c 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -32,7 +32,7 @@ ul.topiclist dt, ul.topiclist dd {
ul.topiclist dt {
width: 100%;
- margin-right: -410px;
+ margin-right: -440px;
font-size: 1.1em;
}
@@ -49,7 +49,7 @@ ul.topiclist.two-columns dt {
}
ul.topiclist dt .list-inner {
- margin-right: 410px;
+ margin-right: 440px;
padding-left: 5px;
padding-right: 5px;
}
@@ -119,11 +119,11 @@ li.header dt, li.header dd {
li.header dt {
font-weight: bold;
width: 100%;
- margin-right: -410px;
+ margin-right: -440px;
}
li.header dt .list-inner {
- margin-right: 410px;
+ margin-right: 440px;
}
li.header dd {
@@ -181,6 +181,10 @@ dd.posts, dd.topics, dd.views, dd.extra, dd.mark {
font-size: 1.2em;
}
+dd.posts, dd.topics, dd.views {
+ width: 95px;
+}
+
/* List in forum description */
dl.icon dt ol,
dl.icon dt ul {
@@ -731,6 +735,10 @@ fieldset.polls dd div {
height: auto !important;
}
+dd.profile-warnings {
+ font-weight: bold;
+}
+
dd.profile-contact {
overflow: visible;
}
@@ -793,6 +801,17 @@ div.dl_links {
display: inline-block;
}
+.attachment-filename {
+ width: 100%;
+}
+
+.ellipsis-text {
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
/* Show scrollbars for items with overflow on iOS devices
----------------------------------------*/
.postbody .content::-webkit-scrollbar, #topicreview::-webkit-scrollbar, #post_details::-webkit-scrollbar, .codebox code::-webkit-scrollbar, .attachbox dd::-webkit-scrollbar, .attach-image::-webkit-scrollbar, .dropdown-extended ul::-webkit-scrollbar {
diff --git a/phpBB/styles/prosilver/theme/plupload.css b/phpBB/styles/prosilver/theme/plupload.css
index 8569eca662..f81064dbe6 100644
--- a/phpBB/styles/prosilver/theme/plupload.css
+++ b/phpBB/styles/prosilver/theme/plupload.css
@@ -74,3 +74,8 @@
height: 16px;
width: 16px;
}
+
+.file-name {
+ max-width: 65%;
+ vertical-align: bottom;
+}
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 456bbf3479..9a8ed5d399 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -66,3 +66,8 @@ dd.option {
.icon-notification {
*z-index: 2;
}
+
+/* Fixes header-avatar aspect-ratio in IE8 */
+.header-avatar img {
+ height: 25px;
+}
diff --git a/phpBB/styles/subsilver2/template/simple_header.html b/phpBB/styles/subsilver2/template/simple_header.html
index 37a33415e9..36ac149691 100644
--- a/phpBB/styles/subsilver2/template/simple_header.html
+++ b/phpBB/styles/subsilver2/template/simple_header.html
@@ -9,6 +9,11 @@
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
<link rel="stylesheet" href="{T_STYLESHEET_LANG_LINK}" type="text/css" />
+
+<!-- EVENT simple_header_head_append -->
+
+{$STYLESHEETS}
+
</head>
<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index 6ac4e0ea33..0c7900076b 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -141,7 +141,7 @@
<!-- IF postrow.S_POST_HIDDEN -->
<td class="gensmall" colspan="2" height="25" align="center">
- <!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF -->
+ <!-- IF postrow.S_FIRST_UNREAD --><a id="unread" data-url="{postrow.U_MINI_POST}"></a><!-- ENDIF -->
<a name="p{postrow.POST_ID}"></a>
<!-- IF postrow.S_POST_HIDDEN -->
<!-- IF postrow.S_POST_DELETED -->
@@ -155,7 +155,7 @@
<!-- ELSE -->
<td align="center" valign="middle">
- <!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a>
+ <!-- IF postrow.S_FIRST_UNREAD --><a id="unread" data-url="{postrow.U_MINI_POST}"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a>
<b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.POST_AUTHOR}</b>
</td>
<td width="100%" height="25">
@@ -204,6 +204,7 @@
<span class="postdetails">
<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}{L_COLON}</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
<!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}{L_COLON}</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
+ <!-- IF postrow.POSTER_WARNINGS --><br /><b>{L_WARNINGS}{L_COLON}</b> {postrow.POSTER_WARNINGS}<!-- ENDIF -->
<!-- IF postrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 84040af2bb..a0cd590e58 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1642,7 +1642,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'POSTER_JOINED' => $user_cache[$poster_id]['joined'],
'POSTER_POSTS' => $user_cache[$poster_id]['posts'],
'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'],
- 'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'],
+ 'POSTER_WARNINGS' => $auth->acl_get('m_warn') ? $user_cache[$poster_id]['warnings'] : '',
'POSTER_AGE' => $user_cache[$poster_id]['age'],
'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index 527bb223d5..69d4280b9a 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -9,29 +9,33 @@
require_once dirname(__FILE__) . '/driver/foobar.php';
-class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
+class phpbb_avatar_manager_test extends \phpbb_test_case
{
+ /** @var \phpbb\avatar\manager */
+ protected $manager;
+ protected $avatar_foobar;
+ protected $avatar_barfoo;
+
public function setUp()
{
global $phpbb_root_path, $phpEx;
// Mock phpbb_container
- $this->phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $this->phpbb_container->expects($this->any())
+ $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $phpbb_container->expects($this->any())
->method('get')
->will($this->returnArgument(0));
// Prepare dependencies for avatar manager and driver
$config = new \phpbb\config\config(array());
- $request = $this->getMock('\phpbb\request\request');
$cache = $this->getMock('\phpbb\cache\driver\driver_interface');
$path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request(
new phpbb_mock_request()
),
new \phpbb\filesystem(),
- $this->phpbb_root_path,
- $this->phpEx
+ $phpbb_root_path,
+ $phpEx
);
// $this->avatar_foobar will be needed later on
@@ -60,7 +64,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
$config['allow_avatar_' . get_class($this->avatar_barfoo)] = false;
// Set up avatar manager
- $this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $this->phpbb_container);
+ $this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $phpbb_container);
}
protected function avatar_drivers()
@@ -222,8 +226,6 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
*/
public function test_clean_row(array $input, array $output, $prefix = '')
{
- $cleaned_row = array();
-
$cleaned_row = \phpbb\avatar\manager::clean_row($input, $prefix);
foreach ($output as $key => $value)
{
diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php
index d0dcce5bbf..4bf5037f45 100644
--- a/tests/bbcode/parser_test.php
+++ b/tests/bbcode/parser_test.php
@@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
-class phpbb_bbcode_parser_test extends PHPUnit_Framework_TestCase
+class phpbb_bbcode_parser_test extends \phpbb_test_case
{
public function bbcode_firstpass_data()
{
diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php
index 58e57f2b3a..049d0412b6 100644
--- a/tests/cache/null_driver_test.php
+++ b/tests/cache/null_driver_test.php
@@ -35,14 +35,12 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
public function test_purge()
{
- // does nothing
- $this->driver->purge();
+ $this->assertNull($this->driver->purge());
}
public function test_destroy()
{
- // does nothing
- $this->driver->destroy('foo');
+ $this->assertNull($this->driver->destroy('foo'));
}
public function test_cache_sql()
diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php
index 6e551f658a..d3c7bb0579 100644
--- a/tests/class_loader/class_loader_test.php
+++ b/tests/class_loader/class_loader_test.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
+class phpbb_class_loader_test extends \phpbb_test_case
{
public function setUp()
{
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php
index 7d9fe652eb..7b8b78dd22 100644
--- a/tests/controller/controller_test.php
+++ b/tests/controller/controller_test.php
@@ -29,7 +29,8 @@ class phpbb_controller_controller_test extends phpbb_test_case
public function test_provider()
{
- $provider = new \phpbb\controller\provider($this->extension_manager->get_finder());
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($this->extension_manager->get_finder());
$routes = $provider->find(__DIR__)->get_routes();
// This will need to be updated if any new routes are defined
diff --git a/tests/controller/helper_route_test.php b/tests/controller/helper_route_test.php
index 5264c788c7..ae6f924a62 100644
--- a/tests/controller/helper_route_test.php
+++ b/tests/controller/helper_route_test.php
@@ -27,23 +27,25 @@ class phpbb_controller_helper_route_test extends phpbb_test_case
);
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
$this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $this->user, new \phpbb\template\context());
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ )
+ );
$finder = new \phpbb\extension\finder(
- new phpbb_mock_extension_manager(
- dirname(__FILE__) . '/',
- array(
- 'vendor2/foo' => array(
- 'ext_name' => 'vendor2/foo',
- 'ext_active' => '1',
- 'ext_path' => 'ext/vendor2/foo/',
- ),
- )
- ),
+ $this->extension_manager,
new \phpbb\filesystem(),
dirname(__FILE__) . '/',
new phpbb_mock_cache()
);
- $this->provider = new \phpbb\controller\provider($finder);
+ $this->provider = new \phpbb\controller\provider();
+ $this->provider->find_routing_files($finder);
$this->provider->find(dirname(__FILE__) . '/');
}
@@ -82,7 +84,7 @@ class phpbb_controller_helper_route_test extends phpbb_test_case
*/
public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
- $this->helper = new \phpbb\controller\helper($this->template, $this->user, $this->config, $this->provider, '', 'php');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, '', 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id));
}
@@ -122,7 +124,7 @@ class phpbb_controller_helper_route_test extends phpbb_test_case
public function test_helper_url_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
- $this->helper = new \phpbb\controller\helper($this->template, $this->user, $this->config, $this->provider, '', 'php');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, '', 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id));
}
}
diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php
index 713f44c1e2..937add252f 100644
--- a/tests/cron/manager_test.php
+++ b/tests/cron/manager_test.php
@@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/tasks/simple_ready.php';
require_once dirname(__FILE__) . '/tasks/simple_not_runnable.php';
require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php';
-class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
+class phpbb_cron_manager_test extends \phpbb_test_case
{
public function setUp()
{
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php
index fbcbfa3943..86d3930a7b 100644
--- a/tests/functional/feed_test.php
+++ b/tests/functional/feed_test.php
@@ -480,7 +480,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_create_softdelete_post()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->login();
$this->load_ids(array(
'forums' => array(
@@ -504,7 +503,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_softdelete_post()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->login();
$this->load_ids(array(
'forums' => array(
@@ -532,7 +530,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_softdeleted_post_admin()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->load_ids(array(
'forums' => array(
'Feeds #1',
@@ -575,7 +572,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_softdeleted_post_guest()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->load_ids(array(
'forums' => array(
'Feeds #1',
@@ -609,7 +605,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_softdelete_topic()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->login();
$this->load_ids(array(
'forums' => array(
@@ -639,7 +634,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_softdeleted_topic_admin()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->load_ids(array(
'forums' => array(
'Feeds #1',
@@ -709,7 +703,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_softdeleted_topic_guest()
{
- $this->markTestIncomplete('Softdeleted posts/topics are not marked in feeds yet, see PHPBB3-12460');
$this->load_ids(array(
'forums' => array(
'Feeds #1',
@@ -758,7 +751,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_create_unapproved_post()
{
- $this->markTestIncomplete('Unapproved posts/topics are not marked in feeds yet, see PHPBB3-12459');
$this->load_ids(array(
'forums' => array(
'Feeds #1.1',
@@ -780,7 +772,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_unapproved_post_admin()
{
- $this->markTestIncomplete('Unapproved posts/topics are not marked in feeds yet, see PHPBB3-12459');
$this->load_ids(array(
'forums' => array(
'Feeds #1.1',
@@ -823,7 +814,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_unapproved_post_disapprove_user()
{
- $this->markTestIncomplete('Unapproved posts/topics are not marked in feeds yet, see PHPBB3-12459');
$this->load_ids(array(
'forums' => array(
'Feeds #1.1',
@@ -857,7 +847,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_create_unapproved_topic()
{
- $this->markTestIncomplete('Unapproved posts/topics are not marked in feeds yet, see PHPBB3-12459');
$this->load_ids(array(
'forums' => array(
'Feeds #1.1',
@@ -877,7 +866,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_unapproved_topic_admin()
{
- $this->markTestIncomplete('Unapproved posts/topics are not marked in feeds yet, see PHPBB3-12459');
$this->load_ids(array(
'forums' => array(
'Feeds #1.1',
@@ -944,7 +932,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_unapproved_topic_disapprove_user()
{
- $this->markTestIncomplete('Unapproved posts/topics are not marked in feeds yet, see PHPBB3-12459');
$this->load_ids(array(
'forums' => array(
'Feeds #1.1',
@@ -1026,7 +1013,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
$this->assert_feeds(array(
'f' => array(
array(
- 'nb_entries' => 2,
+ 'nb_entries' => 4,
'id' => $this->data['forums']['Feeds #1'],
'attachments' => array(
1 => array( // First entry
@@ -1054,7 +1041,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'overall' => array(
array(
- 'nb_entries' => 6,
+ 'nb_entries' => 11,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1067,7 +1054,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics' => array(
array(
- 'nb_entries' => 5,
+ 'nb_entries' => 8,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1080,7 +1067,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics_new' => array(
array(
- 'nb_entries' => 5,
+ 'nb_entries' => 8,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1093,7 +1080,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics_active' => array(
array(
- 'nb_entries' => 5,
+ 'nb_entries' => 8,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1153,7 +1140,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'overall' => array(
array(
- 'nb_entries' => 6,
+ 'nb_entries' => 7,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1166,7 +1153,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics' => array(
array(
- 'nb_entries' => 5,
+ 'nb_entries' => 6,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1179,7 +1166,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics_new' => array(
array(
- 'nb_entries' => 5,
+ 'nb_entries' => 6,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1192,7 +1179,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics_active' => array(
array(
- 'nb_entries' => 5,
+ 'nb_entries' => 6,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
@@ -1208,7 +1195,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_create_missing_attachment_post()
{
- $this->markTestIncomplete('Missing attachments in posts/topics are not marked in feeds yet, see PHPBB3-12418');
$this->login();
$this->load_ids(array(
'forums' => array(
@@ -1229,7 +1215,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_missing_attachment_admin()
{
- $this->markTestIncomplete('Missing attachments in posts/topics are not marked in feeds yet, see PHPBB3-12418');
$this->load_ids(array(
'forums' => array(
'Feeds #1',
@@ -1265,7 +1250,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'overall' => array(
array(
- 'nb_entries' => 13,
+ 'nb_entries' => 12,
'contents' => array(
1 => 'Attachment #0',
),
@@ -1273,12 +1258,12 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics' => array(
array(
- 'nb_entries' => 9,
+ 'nb_entries' => 8,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
- 'displayed' => false,
+ 'displayed' => true,
),
),
),
@@ -1286,12 +1271,12 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics_new' => array(
array(
- 'nb_entries' => 9,
+ 'nb_entries' => 8,
'attachments' => array(
1 => array( // First entry
array( // First attachment to fetch
'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
- 'displayed' => false,
+ 'displayed' => true,
),
),
),
@@ -1299,7 +1284,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
'topics_active' => array(
array(
- 'nb_entries' => 9,
+ 'nb_entries' => 8,
'contents' => array(
1 => 'Attachment #0',
),
@@ -1409,13 +1394,12 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
if ($attachment['displayed'])
{
$this->assertContains($url, $content, "Tested feed : 'feed.php{$params}'");
- // $this->assertNotContains($string, $content, "Tested feed : 'feed.php{$params}'");
+ $this->assertNotContains($string, $content, "Tested feed : 'feed.php{$params}'");
}
else
{
- // Disabled until PHPBB3-12421 is fixed and merged
- // $this->assertContains($string, $content, "Tested feed : 'feed.php{$params}'");
- // $this->assertNotContains($url, $content, "Tested feed : 'feed.php{$params}'");
+ $this->assertContains($string, $content, "Tested feed : 'feed.php{$params}'");
+ $this->assertNotContains($url, $content, "Tested feed : 'feed.php{$params}'");
}
}
}
diff --git a/tests/functional/ucp_allow_pm_test.php b/tests/functional/ucp_allow_pm_test.php
new file mode 100644
index 0000000000..b433ec8e75
--- /dev/null
+++ b/tests/functional/ucp_allow_pm_test.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_allow_pm_test extends phpbb_functional_test_case
+{
+ static protected $data = array();
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->backupStaticAttributesBlacklist += array(
+ 'phpbb_functional_ucp_allow_pm_test' => array('data'),
+ );
+ }
+
+ // user A sends a PM to user B where B accepts PM
+ public function test_enabled_pm_user_to_user()
+ {
+ // setup
+ $this->create_user('test_ucp_allow_pm_sender');
+ $this->login('test_ucp_allow_pm_sender');
+ self::$data['recipient_id'] = $this->create_user('test_ucp_allow_pm_recipient');
+ self::$data['pm_url'] = "ucp.php?i=pm&mode=compose&u=" . (int) self::$data['recipient_id'] . "&sid={$this->sid}";
+
+ // the actual test
+ $this->set_user_allow_pm(self::$data['recipient_id'], 1);
+ $crawler = self::request('GET', self::$data['pm_url']);
+ $this->assertNotContainsLang('PM_USERS_REMOVED_NO_PM', $crawler->filter('html')->text());
+ }
+
+ // user A sends a PM to user B where B does not accept PM
+ public function test_disabled_pm_user_to_user()
+ {
+ $this->login('test_ucp_allow_pm_sender');
+ $this->set_user_allow_pm(self::$data['recipient_id'], 0);
+ $crawler = self::request('GET', self::$data['pm_url']);
+ $this->assertContainsLang('PM_USERS_REMOVED_NO_PM', $crawler->filter('.error')->text());
+ }
+
+
+ // An admin sends a PM to user B where B does not accept PM, but cannot
+ // ignore a PM from an admin
+ public function test_disabled_pm_admin_to_user()
+ {
+ $this->login();
+ $crawler = self::request('GET', self::$data['pm_url']);
+ $this->assertNotContainsLang('PM_USERS_REMOVED_NO_PM', $crawler->filter('html')->text());
+ }
+
+ // enable or disable PM for a user, like from ucp
+ protected function set_user_allow_pm($user_id, $allow)
+ {
+ $db = $this->get_db();
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_allow_pm = " . $allow . "
+ WHERE user_id = " . $user_id;
+ $result = $db->sql_query($sql);
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php
index f8ada9687c..3d44476ff0 100644
--- a/tests/functional/visibility_softdelete_test.php
+++ b/tests/functional/visibility_softdelete_test.php
@@ -608,7 +608,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
- $this->assertContainsLang('POST_DELETED', $crawler->filter('body')->text());
+ $this->assertContainsLang('POST_DELETED_ACTION', $crawler->filter('body')->text());
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
'forum_posts_approved' => 1,
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php
index 795427ffe8..ad36f29b8c 100644
--- a/tests/functions/build_url_test.php
+++ b/tests/functions/build_url_test.php
@@ -45,6 +45,11 @@ class phpbb_build_url_test extends phpbb_test_case
'phpBB/index.php?',
),
array(
+ 'viewtopic.php?t=5&f=4',
+ false,
+ 'phpBB/viewtopic.php?t=5&amp;f=4',
+ ),
+ array(
'viewtopic.php?f=2&style=1&t=6',
'f',
'phpBB/viewtopic.php?style=1&amp;t=6',
diff --git a/tests/mock/controller_helper.php b/tests/mock/controller_helper.php
new file mode 100644
index 0000000000..01ac6494d0
--- /dev/null
+++ b/tests/mock/controller_helper.php
@@ -0,0 +1,22 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_mock_controller_helper extends \phpbb\controller\helper
+{
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, $phpbb_root_path, $php_ext, $phpbb_root_path_ext)
+ {
+ $this->template = $template;
+ $this->user = $user;
+ $this->config = $config;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $provider->find_routing_files($manager->get_finder());
+ $this->route_collection = $provider->find($phpbb_root_path_ext)->get_routes();
+ }
+}
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index 71206dff58..f7a02dc419 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -30,17 +30,19 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
->method('lang')
->will($this->returnCallback(array($this, 'return_callback_implode')));
+ $manager = new phpbb_mock_extension_manager(dirname(__FILE__) . '/', array());
$this->finder = new \phpbb\extension\finder(
- new phpbb_mock_extension_manager(dirname(__FILE__) . '/', array()),
+ $manager,
new \phpbb\filesystem(),
dirname(__FILE__) . '/',
new phpbb_mock_cache()
);
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
- $provider = new \phpbb\controller\provider($this->finder);
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($this->finder);
$provider->find(dirname(__FILE__) . '/');
- $this->helper = new \phpbb\controller\helper($this->template, $this->user, $this->config, $provider, '', 'php');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $provider, $manager, '', 'php', dirname(__FILE__) . '/');
$this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper);
}
diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php
index 40bb110185..df1474419b 100644
--- a/tests/passwords/drivers_test.php
+++ b/tests/passwords/drivers_test.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_passwords_helper_test extends PHPUnit_Framework_TestCase
+class phpbb_passwords_helper_test extends \phpbb_test_case
{
public function setUp()
{
diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php
index 008f222696..561c4d1189 100644
--- a/tests/passwords/manager_test.php
+++ b/tests/passwords/manager_test.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
+class phpbb_passwords_manager_test extends \phpbb_test_case
{
protected $passwords_drivers;
@@ -176,7 +176,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
}
}
- public function test_combined_hash_data()
+ public function combined_hash_data()
{
if (version_compare(PHP_VERSION, '5.3.7', '<'))
{
@@ -242,7 +242,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
}
/**
- * @dataProvider test_combined_hash_data
+ * @dataProvider combined_hash_data
*/
public function test_combined_hash_password($first_type, $second_type, $expected = true)
{