Merge branch '3.2.x' into ticket/15948

This commit is contained in:
3Di 2019-03-23 05:09:17 +01:00 committed by GitHub
commit 6921565efe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 554 additions and 168 deletions

View file

@ -1,6 +1,5 @@
language: php
sudo: required
dist: precise
matrix:
include:

View file

@ -33,7 +33,7 @@
"marc1706/fast-image-size": "^1.1",
"paragonie/random_compat": "^1.4",
"patchwork/utf8": "^1.1",
"s9e/text-formatter": "~0.13.0",
"s9e/text-formatter": "^1.3",
"symfony/config": "^2.8",
"symfony/console": "^2.8",
"symfony/debug": "^2.8",

21
phpBB/composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c843abc1344cd9df37f63c08a125cad0",
"content-hash": "6daa2f5f7a161377dee1835bd4d5b463",
"packages": [
{
"name": "bantu/ini-get-wrapper",
@ -661,16 +661,16 @@
},
{
"name": "s9e/text-formatter",
"version": "0.13.1",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/s9e/TextFormatter.git",
"reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f"
"reference": "640b65b0d4c1de93bc98000c003998c08b2e7256"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f",
"reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f",
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/640b65b0d4c1de93bc98000c003998c08b2e7256",
"reference": "640b65b0d4c1de93bc98000c003998c08b2e7256",
"shasum": ""
},
"require": {
@ -681,8 +681,8 @@
},
"require-dev": {
"matthiasmullie/minify": "*",
"php": ">=5.4.7",
"s9e/regexp-builder": ">=1.3.0"
"php-coveralls/php-coveralls": "*",
"s9e/regexp-builder": "1.*"
},
"suggest": {
"ext-curl": "Improves the performance of the MediaEmbed plugin and some JavaScript minifiers",
@ -722,7 +722,7 @@
"parser",
"shortcodes"
],
"time": "2017-12-10T00:55:53+00:00"
"time": "2018-12-23T20:27:39+00:00"
},
{
"name": "symfony/config",
@ -2478,6 +2478,7 @@
"testing",
"xunit"
],
"abandoned": true,
"time": "2015-03-29T14:23:04+00:00"
},
{
@ -2891,9 +2892,7 @@
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
"email": "fabien@symfony.com"
}
],
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",

View file

@ -208,6 +208,7 @@ services:
console.command.thumbnail.delete:
class: phpbb\console\command\thumbnail\delete
arguments:
- '@config'
- '@user'
- '@dbal.conn'
- '%core.root_path%'
@ -217,6 +218,7 @@ services:
console.command.thumbnail.generate:
class: phpbb\console\command\thumbnail\generate
arguments:
- '@config'
- '@user'
- '@dbal.conn'
- '@cache'

View file

@ -104,3 +104,6 @@ Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
MIT licenced:
Symfony2 (c) 2004-2011 Fabien Potencier, https://symfony.com/
Cookie Consent (c) 2015 Silktide Ltd, https://cookieconsent.insites.com
Emoji by:
Twemoji (c) 2018 Twitter, Inc, https://twemoji.twitter.com/

View file

@ -147,7 +147,7 @@
<li>Oracle</li>
</ul>
</li>
<li><strong>PHP 5.4.7+</strong> with support for the database you intend to use.</li>
<li><strong>PHP 5.4.7+</strong> but less than <strong>PHP 7.3</strong> with support for the database you intend to use.</li>
<li>The following PHP modules are required:
<ul>
<li>json</li>

View file

@ -1009,6 +1009,20 @@ mcp_post_report_buttons_top_before
* Since: 3.2.4-RC1
* Purpose: Add content before report buttons
mcp_post_text_after
===
* Locations:
+ styles/prosilver/template/mcp_post.html
* Since: 3.2.6-RC1
* Purpose: Add content after the post text
mcp_post_text_before
===
* Locations:
+ styles/prosilver/template/mcp_post.html
* Since: 3.2.6-RC1
* Purpose: Add content before the post text
mcp_topic_options_after
===
* Locations:
@ -1114,6 +1128,83 @@ mcp_warn_user_add_warning_field_before
* Since: 3.1.0-RC4
* Purpose: Add content during warning a user - before add warning field.
memberlist_body_group_desc_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the group description and type in the group profile page.
memberlist_body_group_name_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the group name in the group profile page.
memberlist_body_group_name_before
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data before the group name in the group profile page.
memberlist_body_group_rank_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the group rank in the group profile page.
memberlist_body_group_rank_before
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data before the group rank in the group profile page.
memberlist_body_leaders_set_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the last row in the memberlist mode leaders.
memberlist_body_memberlist_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the last row in the memberlist.
memberlist_body_memberrow_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the last memberrow in the memberlist.
memberlist_body_page_footer_before
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data before the page footer.
memberlist_body_page_header_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the page header.
memberlist_body_page_title_before
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data before the page title.
memberlist_body_rank_append
===
* Locations:
@ -1130,6 +1221,13 @@ memberlist_body_rank_prepend
* Purpose: Add information before rank in memberlist. Works in
all display modes (leader, group and normal memberlist).
memberlist_body_show_group_after
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
* Since: 3.2.6-RC1
* Purpose: Add data after the last row in the memberlist mode group.
memberlist_body_username_append
===
* Locations:

View file

@ -29,6 +29,9 @@ class acp_groups
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request, $phpbb_container, $phpbb_dispatcher;
/** @var \phpbb\language\language $language Language object */
$language = $phpbb_container->get('language');
$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';
$this->page_title = 'ACP_GROUPS_MANAGE';
@ -293,7 +296,19 @@ class acp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
$display_message = $language->lang($error);
if ($error == 'GROUP_USERS_INVALID')
{
// Find which users don't exist
$actual_name_ary = $name_ary;
$actual_user_id_ary = [];
user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true);
$display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp')));
}
trigger_error($display_message . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
}
$message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';

View file

@ -24,9 +24,9 @@ class acp_inactive
var $u_action;
var $p_master;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -676,7 +676,7 @@ class acp_permissions
/**
* Apply permissions
*/
function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id)
function set_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id)
{
global $db, $cache, $user, $auth;
global $request;
@ -765,7 +765,7 @@ class acp_permissions
/**
* Apply all permissions
*/
function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id)
function set_all_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id)
{
global $db, $cache, $user, $auth;
global $request;
@ -881,7 +881,7 @@ class acp_permissions
/**
* Remove permissions
*/
function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id)
function remove_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id, &$forum_id)
{
global $user, $db, $cache, $auth;

View file

@ -845,7 +845,7 @@ class acp_profile
/**
* Build all Language specific options
*/
function build_language_options(&$cp, $field_type, $action = 'create')
function build_language_options($cp, $field_type, $action = 'create')
{
global $user, $config, $db, $request;
@ -942,7 +942,7 @@ class acp_profile
/**
* Save Profile Field
*/
function save_profile_field(&$cp, $field_type, $action = 'create')
function save_profile_field($cp, $field_type, $action = 'create')
{
global $db, $config, $user, $phpbb_container, $phpbb_log, $request, $phpbb_dispatcher;

View file

@ -24,9 +24,9 @@ class acp_users
var $u_action;
var $p_master;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -3042,6 +3042,8 @@ function tidy_database()
}
$db->sql_freeresult($result);
$db->sql_transaction('begin');
// Delete those rows from the acl tables not having listed the forums above
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true);
@ -3051,6 +3053,8 @@ function tidy_database()
WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true);
$db->sql_query($sql);
$db->sql_transaction('commit');
$config->set('database_last_gc', time(), false);
}

View file

@ -391,7 +391,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
*
* @deprecated 3.1.0 (To be removed: 3.3.0)
*/
function get_tables(&$db)
function get_tables($db)
{
$db_tools_factory = new \phpbb\db\tools\factory();
$db_tools = $db_tools_factory->get($db);

View file

@ -22,12 +22,12 @@ if (!defined('IN_PHPBB'))
/**
* Functions used to generate additional URL paramters
*/
function phpbb_module__url($mode, &$module_row)
function phpbb_module__url($mode, $module_row)
{
return phpbb_extra_url();
}
function phpbb_module_notes_url($mode, &$module_row)
function phpbb_module_notes_url($mode, $module_row)
{
if ($mode == 'front')
{
@ -38,7 +38,7 @@ function phpbb_module_notes_url($mode, &$module_row)
return ($user_id) ? "&amp;u=$user_id" : '';
}
function phpbb_module_warn_url($mode, &$module_row)
function phpbb_module_warn_url($mode, $module_row)
{
if ($mode == 'front' || $mode == 'list')
{
@ -64,27 +64,27 @@ function phpbb_module_warn_url($mode, &$module_row)
}
}
function phpbb_module_main_url($mode, &$module_row)
function phpbb_module_main_url($mode, $module_row)
{
return phpbb_extra_url();
}
function phpbb_module_logs_url($mode, &$module_row)
function phpbb_module_logs_url($mode, $module_row)
{
return phpbb_extra_url();
}
function phpbb_module_ban_url($mode, &$module_row)
function phpbb_module_ban_url($mode, $module_row)
{
return phpbb_extra_url();
}
function phpbb_module_queue_url($mode, &$module_row)
function phpbb_module_queue_url($mode, $module_row)
{
return phpbb_extra_url();
}
function phpbb_module_reports_url($mode, &$module_row)
function phpbb_module_reports_url($mode, $module_row)
{
return phpbb_extra_url();
}

View file

@ -202,11 +202,13 @@ function update_post_information($type, $ids, $return_update_sql = false)
if (count($ids) == 1)
{
$sql = 'SELECT MAX(p.post_id) as last_post_id
$sql = 'SELECT p.post_id as last_post_id
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
AND p.post_visibility = " . ITEM_APPROVED;
AND p.post_visibility = " . ITEM_APPROVED . "
ORDER BY p.post_id DESC";
$result = $db->sql_query_limit($sql, 1);
}
else
{
@ -216,8 +218,8 @@ function update_post_information($type, $ids, $return_update_sql = false)
$topic_condition
AND p.post_visibility = " . ITEM_APPROVED . "
GROUP BY p.{$type}_id";
$result = $db->sql_query($sql);
}
$result = $db->sql_query($sql);
$last_post_ids = array();
while ($row = $db->sql_fetchrow($result))

View file

@ -26,8 +26,10 @@ if (!defined('IN_PHPBB'))
* @param array &$user_id_ary The user ids to check or empty if usernames used
* @param array &$username_ary The usernames to check or empty if user ids used
* @param mixed $user_type Array of user types to check, false if not restricting by user type
* @param boolean $update_references If false, the supplied array is unset and appears unchanged from where it was called
* @return boolean|string Returns false on success, error string on failure
*/
function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false, $update_references = false)
{
global $db;
@ -50,7 +52,13 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
}
$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});
unset(${$which_ary});
// By unsetting the array here, the values passed in at the point user_get_id_name() was called will be retained.
// Otherwise, if we don't unset (as the array was passed by reference) the original array will be updated below.
if ($update_references === false)
{
unset(${$which_ary});
}
$user_id_ary = $username_ary = array();
@ -684,7 +692,8 @@ function user_delete($mode, $user_ids, $retain_username = true)
PRIVMSGS_RULES_TABLE,
$phpbb_container->getParameter('tables.auth_provider_oauth_token_storage'),
$phpbb_container->getParameter('tables.auth_provider_oauth_states'),
$phpbb_container->getParameter('tables.auth_provider_oauth_account_assoc')
$phpbb_container->getParameter('tables.auth_provider_oauth_account_assoc'),
$phpbb_container->getParameter('tables.user_notifications')
];
// Ignore errors on deleting from non-existent tables, e.g. when migrating
@ -2698,6 +2707,13 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
return 'NO_USER';
}
// Because the item that gets passed into the previous function is unset, the reference is lost and our original
// array is retained - so we know there's a problem if there's a different number of ids to usernames now.
if (count($user_id_ary) != count($username_ary))
{
return 'GROUP_USERS_INVALID';
}
// Remove users who are already members of this group
$sql = 'SELECT user_id, group_leader
FROM ' . USER_GROUP_TABLE . '

View file

@ -34,7 +34,10 @@ class mcp_ban
}
// Include the admin banning interface...
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
if (!class_exists('acp_ban'))
{
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
}
$bansubmit = $request->is_set_post('bansubmit');
$unbansubmit = $request->is_set_post('unbansubmit');

View file

@ -290,7 +290,10 @@ function mcp_front_view($id, $mode, $action)
if ($total)
{
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
if (!function_exists('get_recipient_strings'))
{
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
}
$sql_ary = array(
'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, p.message_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id',

View file

@ -28,9 +28,9 @@ class mcp_logs
var $u_action;
var $p_master;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -28,9 +28,9 @@ class mcp_main
var $p_master;
var $u_action;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)
@ -174,7 +174,10 @@ class mcp_main
switch ($mode)
{
case 'front':
include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);
if (!function_exists('mcp_front_view'))
{
include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);
}
$user->add_lang('acp/common');
@ -185,7 +188,10 @@ class mcp_main
break;
case 'forum_view':
include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
if (!function_exists('mcp_forum_view'))
{
include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
}
$user->add_lang('viewforum');
@ -208,7 +214,10 @@ class mcp_main
break;
case 'topic_view':
include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);
if (!function_exists('mcp_topic_view'))
{
include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);
}
mcp_topic_view($id, $mode, $action);
@ -217,7 +226,10 @@ class mcp_main
break;
case 'post_details':
include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);
if (!function_exists('mcp_post_details'))
{
include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);
}
mcp_post_details($id, $mode, $action);
@ -414,6 +426,7 @@ function change_topic_type($action, $topic_ids)
if (confirm_box(true))
{
/**
* Perform additional actions before changing topic(s) type
*
@ -430,6 +443,8 @@ function change_topic_type($action, $topic_ids)
);
extract($phpbb_dispatcher->trigger_event('core.mcp_change_topic_type_before', compact($vars)));
$db->sql_transaction('begin');
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids);
@ -441,13 +456,10 @@ function change_topic_type($action, $topic_ids)
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);
}
$db->sql_transaction('commit');
$success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';
if (count($topic_ids))

View file

@ -28,9 +28,9 @@ class mcp_notes
var $p_master;
var $u_action;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -28,9 +28,9 @@ class mcp_pm_reports
var $p_master;
var $u_action;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -28,9 +28,9 @@ class mcp_queue
var $p_master;
var $u_action;
public function __construct(&$p_master)
public function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
public function main($id, $mode)

View file

@ -28,9 +28,9 @@ class mcp_reports
var $p_master;
var $u_action;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -93,7 +93,11 @@ function mcp_topic_view($id, $mode, $action)
// Restore or pprove posts?
if (($action == 'restore' || $action == 'approve') && $auth->acl_get('m_approve', $topic_info['forum_id']))
{
include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx);
if (!class_exists('mcp_queue'))
{
include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx);
}
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

View file

@ -28,9 +28,9 @@ class mcp_warn
var $p_master;
var $u_action;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)

View file

@ -1587,6 +1587,16 @@ class parse_message extends bbcode_firstpass
'poster_id' => $user->data['user_id'],
);
/**
* Modify attachment sql array on submit
*
* @event core.modify_attachment_sql_ary_on_submit
* @var array sql_ary Array containing SQL data
* @since 3.2.6-RC1
*/
$vars = array('sql_ary');
extract($phpbb_dispatcher->trigger_event('core.modify_attachment_sql_ary_on_submit', compact($vars)));
$db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_entry = array(
@ -1722,6 +1732,16 @@ class parse_message extends bbcode_firstpass
'poster_id' => $user->data['user_id'],
);
/**
* Modify attachment sql array on upload
*
* @event core.modify_attachment_sql_ary_on_upload
* @var array sql_ary Array containing SQL data
* @since 3.2.6-RC1
*/
$vars = array('sql_ary');
extract($phpbb_dispatcher->trigger_event('core.modify_attachment_sql_ary_on_upload', compact($vars)));
$db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_entry = array(

View file

@ -32,6 +32,9 @@ class ucp_groups
global $db, $user, $auth, $cache, $template;
global $request, $phpbb_container, $phpbb_log;
/** @var \phpbb\language\language $language Language object */
$language = $phpbb_container->get('language');
$user->add_lang('groups');
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
@ -396,7 +399,10 @@ class ucp_groups
$action = (isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', '');
$group_id = $request->variable('g', 0);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
add_form_key('ucp_groups');
@ -1054,13 +1060,27 @@ class ucp_groups
if (confirm_box(true))
{
$return_manage_page = '<br /><br />' . $language->lang('RETURN_PAGE', '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>');
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row))
{
trigger_error($user->lang[$error] . $return_page);
$display_message = $language->lang($error);
if ($error == 'GROUP_USERS_INVALID')
{
// Find which users don't exist
$actual_name_ary = $name_ary;
$actual_user_id_ary = [];
user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true);
$display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp')));
}
trigger_error($display_message . $return_manage_page);
}
trigger_error($user->lang['GROUP_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>'));
trigger_error($language->lang('GROUP_USERS_ADDED') . $return_manage_page);
}
else
{

View file

@ -28,9 +28,9 @@ class ucp_main
var $p_master;
var $u_action;
function __construct(&$p_master)
function __construct($p_master)
{
$this->p_master = &$p_master;
$this->p_master = $p_master;
}
function main($id, $mode)
@ -245,7 +245,10 @@ class ucp_main
case 'subscribed':
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
if (!function_exists('topic_status'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
$user->add_lang('viewforum');
@ -481,7 +484,10 @@ class ucp_main
break;
}
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
if (!function_exists('topic_status'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
$user->add_lang('viewforum');

View file

@ -82,7 +82,10 @@ class ucp_pm
$mode = 'view';
}
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
if (!function_exists('get_folder'))
{
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
}
switch ($mode)
{
@ -104,7 +107,10 @@ class ucp_pm
break;
}
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
if (!function_exists('compose_pm'))
{
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
}
compose_pm($id, $mode, $action, $user_folders);
$tpl_file = 'posting_body';
@ -114,7 +120,10 @@ class ucp_pm
set_user_message_limit();
get_folder($user->data['user_id']);
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx);
if (!function_exists('message_options'))
{
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx);
}
message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions);
$tpl_file = 'ucp_pm_options';
@ -125,8 +134,10 @@ class ucp_pm
get_folder($user->data['user_id']);
$this->p_name = 'pm';
// Call another module... please do not try this at home... Hoochie Coochie Man
include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx);
if (!class_exists('ucp_main'))
{
include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx);
}
$module = new ucp_main($this);
$module->u_action = $this->u_action;
@ -375,7 +386,10 @@ class ucp_pm
if ($action == 'view_folder')
{
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx);
if (!function_exists('view_folder'))
{
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx);
}
view_folder($id, $mode, $folder_id, $folder);
$tpl_file = 'ucp_pm_viewfolder';
@ -393,7 +407,10 @@ class ucp_pm
trigger_error('NO_MESSAGE');
}
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx);
if (!function_exists('view_message'))
{
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx);
}
view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row);
$tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage';

View file

@ -33,9 +33,20 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Needed for handle_message_list_actions()
global $refresh, $submit, $preview;
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
if (!function_exists('generate_smilies'))
{
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
}
if (!function_exists('display_custom_bbcodes'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
if (!class_exists('parse_message'))
{
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
}
if (!$action)
{
@ -1195,7 +1206,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$controller_helper = $phpbb_container->get('controller.helper');
// Start assigning vars for main posting page ...
$template->assign_vars(array(
$template_ary = array(
'L_POST_A' => $page_title,
'L_ICON' => $user->lang['PM_ICON'],
'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']),
@ -1240,7 +1251,19 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']),
'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&amp;mode=popup'),
'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&amp;mode=popup')),
));
);
/**
* Modify the default template vars
*
* @event core.ucp_pm_compose_template
* @var array template_ary Template variables
* @since 3.2.6-RC1
*/
$vars = array('template_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_template', compact($vars)));
$template->assign_vars($template_ary);
// Build custom bbcodes array
display_custom_bbcodes();

View file

@ -469,8 +469,15 @@ class ucp_profile
trigger_error('NO_AUTH_SIGNATURE');
}
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
if (!function_exists('generate_smilies'))
{
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
}
if (!function_exists('display_custom_bbcodes'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
$preview = $request->is_set_post('preview');

View file

@ -20,9 +20,9 @@ define('PHPBB_ENVIRONMENT', 'production');
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
if (version_compare(PHP_VERSION, '5.4') < 0)
if (version_compare(PHP_VERSION, '5.4.7', '<') || version_compare(PHP_VERSION, '7.3-dev', '>='))
{
die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2');
die('You are running an unsupported PHP version. Please upgrade to PHP equal to or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2');
}
$startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx;

View file

@ -111,6 +111,7 @@ $lang = array_merge($lang, array(
'GROUP_USERS_ADDED' => 'New users added to group successfully.',
'GROUP_USERS_EXIST' => 'The selected users are already members.',
'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.',
'GROUP_USERS_INVALID' => 'No users were added to the group as the following usernames do not exist: %s',
'LEGEND_EXPLAIN' => 'These are the groups which are displayed in the group legend:',
'LEGEND_SETTINGS' => 'Legend settings',

View file

@ -1,4 +1,4 @@
Subject: Private Message report - "{TOPIC_TITLE}"
Subject: Private Message report - "{SUBJECT}"
Hello {USERNAME},

View file

@ -145,6 +145,7 @@ $lang = array_merge($lang, array(
'LOAD_DRAFT_EXPLAIN' => 'Here you are able to select the draft you want to continue writing. Your current post will be cancelled, all current post contents will be deleted. View, edit and delete drafts within your User Control Panel.',
'LOGIN_EXPLAIN_BUMP' => 'You need to login in order to bump topics within this forum.',
'LOGIN_EXPLAIN_DELETE' => 'You need to login in order to delete posts within this forum.',
'LOGIN_EXPLAIN_SOFT_DELETE' => 'You need to login in order to soft-delete posts within this forum.',
'LOGIN_EXPLAIN_POST' => 'You need to login in order to post within this forum.',
'LOGIN_EXPLAIN_QUOTE' => 'You need to login in order to quote posts within this forum.',
'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum.',

View file

@ -489,9 +489,31 @@ switch ($mode)
}
// Get user...
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id");
$sql_array = array(
'SELECT' => 'u.*',
'FROM' => array(
USERS_TABLE => 'u'
),
'WHERE' => (($username) ? "u.username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "u.user_id = $user_id"),
);
/**
* Modify user data SQL before member profile row is created
*
* @event core.memberlist_modify_viewprofile_sql
* @var int user_id The user ID
* @var string username The username
* @var array sql_array Array containing the main query
* @since 3.2.6-RC1
*/
$vars = array(
'user_id',
'username',
'sql_array',
);
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_viewprofile_sql', compact($vars)));
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$member = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@ -523,12 +545,37 @@ switch ($mode)
$sql_uid_ary = ($auth_hidden_groups) ? array($user_id) : array($user_id, (int) $user->data['user_id']);
// Do the SQL thang
$sql = 'SELECT g.group_id, g.group_name, g.group_type, ug.user_id
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
WHERE ' . $db->sql_in_set('ug.user_id', $sql_uid_ary) . '
AND g.group_id = ug.group_id
AND ug.user_pending = 0';
$result = $db->sql_query($sql);
$sql_ary = [
'SELECT' => 'g.group_id, g.group_name, g.group_type, ug.user_id',
'FROM' => [
GROUPS_TABLE => 'g',
],
'LEFT_JOIN' => [
[
'FROM' => [USER_GROUP_TABLE => 'ug'],
'ON' => 'g.group_id = ug.group_id',
],
],
'WHERE' => $db->sql_in_set('ug.user_id', $sql_uid_ary) . '
AND ug.user_pending = 0',
];
/**
* Modify the query used to get the group data
*
* @event core.modify_memberlist_viewprofile_group_sql
* @var array sql_ary Array containing the query
* @since 3.2.6-RC1
*/
$vars = array(
'sql_ary',
);
extract($phpbb_dispatcher->trigger_event('core.modify_memberlist_viewprofile_group_sql', compact($vars)));
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
// Divide data into profile data and current user data
$profile_groups = $user_groups = array();
@ -567,6 +614,20 @@ switch ($mode)
unset($user_groups);
asort($group_sort);
/**
* Modify group data before options is created and data is unset
*
* @event core.modify_memberlist_viewprofile_group_data
* @var array group_data Array containing the group data
* @var array group_sort Array containing the sorted group data
* @since 3.2.6-RC1
*/
$vars = array(
'group_data',
'group_sort',
);
extract($phpbb_dispatcher->trigger_event('core.modify_memberlist_viewprofile_group_data', compact($vars)));
$group_options = '';
foreach ($group_sort as $group_id => $null)
{

View file

@ -51,7 +51,7 @@ class gd extends captcha_abstract
return 'CAPTCHA_GD';
}
function acp_page($id, &$module)
function acp_page($id, $module)
{
global $user, $template, $phpbb_log, $request;
global $config;

View file

@ -33,7 +33,7 @@ class gd_wave extends captcha_abstract
return '\\phpbb\\captcha\\gd_wave';
}
function acp_page($id, &$module)
function acp_page($id, $module)
{
global $user;

View file

@ -33,7 +33,7 @@ class nogd extends captcha_abstract
return '\\phpbb\\captcha\\non_gd';
}
function acp_page($id, &$module)
function acp_page($id, $module)
{
global $user;

View file

@ -107,8 +107,7 @@ class qa
$sql = 'SELECT q.question_id, q.lang_iso
FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a
WHERE q.question_id = a.question_id
GROUP BY lang_iso';
WHERE q.question_id = a.question_id';
$result = $db->sql_query($sql, 7200);
while ($row = $db->sql_fetchrow($result))
@ -638,7 +637,7 @@ class qa
/**
* API function - The ACP backend, this marks the end of the easy methods
*/
function acp_page($id, &$module)
function acp_page($id, $module)
{
global $config, $request, $phpbb_log, $template, $user;
@ -776,7 +775,7 @@ class qa
/**
* This handles the list overview
*/
function acp_question_list(&$module)
function acp_question_list($module)
{
global $db, $template;

View file

@ -66,7 +66,7 @@ class recaptcha extends captcha_abstract
throw new \Exception('No generator class given.');
}
function acp_page($id, &$module)
function acp_page($id, $module)
{
global $config, $template, $user, $phpbb_log, $request;

View file

@ -18,6 +18,11 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class delete extends \phpbb\console\command\command
{
/**
* @var \phpbb\config\config
*/
protected $config;
/**
* @var \phpbb\db\driver\driver_interface
*/
@ -32,12 +37,14 @@ class delete extends \phpbb\console\command\command
/**
* Constructor
*
* @param \config\config $config The config
* @param \phpbb\user $user The user object (used to get language information)
* @param \phpbb\db\driver\driver_interface $db Database connection
* @param string $phpbb_root_path Root path
*/
public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path)
public function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path)
{
$this->config = $config;
$this->db = $db;
$this->phpbb_root_path = $phpbb_root_path;
@ -101,7 +108,7 @@ class delete extends \phpbb\console\command\command
$return = 0;
while ($row = $this->db->sql_fetchrow($result))
{
$thumbnail_path = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename'];
$thumbnail_path = $this->phpbb_root_path . $this->config['upload_path'] . '/thumb_' . $row['physical_filename'];
if (@unlink($thumbnail_path))
{

View file

@ -19,6 +19,11 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class generate extends \phpbb\console\command\command
{
/**
* @var \phpbb\config\config
*/
protected $config;
/**
* @var \phpbb\db\driver\driver_interface
*/
@ -45,14 +50,16 @@ class generate extends \phpbb\console\command\command
/**
* Constructor
*
* @param \config\config $config The config
* @param \phpbb\user $user The user object (used to get language information)
* @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\cache\service $cache The cache service
* @param string $phpbb_root_path Root path
* @param string $php_ext PHP extension
*/
public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext)
public function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext)
{
$this->config = $config;
$this->db = $db;
$this->cache = $cache;
$this->phpbb_root_path = $phpbb_root_path;
@ -126,8 +133,8 @@ class generate extends \phpbb\console\command\command
{
if (isset($extensions[$row['extension']]['display_cat']) && $extensions[$row['extension']]['display_cat'] == ATTACHMENT_CATEGORY_IMAGE)
{
$source = $this->phpbb_root_path . 'files/' . $row['physical_filename'];
$destination = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename'];
$source = $this->phpbb_root_path . $this->config['upload_path'] . '/' . $row['physical_filename'];
$destination = $this->phpbb_root_path . $this->config['upload_path'] . '/thumb_' . $row['physical_filename'];
if (create_thumbnail($source, $destination, $row['mimetype']))
{

View file

@ -261,7 +261,7 @@ class upload
*
* @param filespec $file Instance of filespec class
*/
public function common_checks(&$file)
public function common_checks($file)
{
// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0))
@ -297,7 +297,7 @@ class upload
*
* @return bool True if extension is allowed, false if not
*/
public function valid_extension(&$file)
public function valid_extension($file)
{
return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false;
}
@ -310,7 +310,7 @@ class upload
* @return bool True if dimensions are valid or no constraints set, false
* if not
*/
public function valid_dimensions(&$file)
public function valid_dimensions($file)
{
if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height)
{
@ -350,7 +350,7 @@ class upload
*
* @return bool True if content is valid, false if not
*/
public function valid_content(&$file)
public function valid_content($file)
{
return ($file->check_content($this->disallowed_content));
}

View file

@ -78,10 +78,10 @@ class obtain_database_data extends \phpbb\install\task_base implements \phpbb\in
$dbms = $this->io_handler->get_input('dbms', '');
$dbhost = $this->io_handler->get_input('dbhost', '', true);
$dbport = $this->io_handler->get_input('dbport', '');
$dbuser = $this->io_handler->get_input('dbuser', '');
$dbpasswd = $this->io_handler->get_raw_input('dbpasswd', '');
$dbname = $this->io_handler->get_input('dbname', '');
$table_prefix = $this->io_handler->get_input('table_prefix', '');
$dbuser = $this->io_handler->get_input('dbuser', '', true);
$dbpasswd = $this->io_handler->get_raw_input('dbpasswd', '', true);
$dbname = $this->io_handler->get_input('dbname', '', true);
$table_prefix = $this->io_handler->get_input('table_prefix', '', true);
// Check database data
$user_data_vaild = $this->check_database_data($dbms, $dbhost, $dbport, $dbuser, $dbpasswd, $dbname, $table_prefix);

View file

@ -50,11 +50,11 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
// E-mail data
$email_enable = $this->io_handler->get_input('email_enable', true);
$smtp_delivery = $this->io_handler->get_input('smtp_delivery', '');
$smtp_host = $this->io_handler->get_input('smtp_host', '');
$smtp_host = $this->io_handler->get_input('smtp_host', '', true);
$smtp_port = $this->io_handler->get_input('smtp_port', '');
$smtp_auth = $this->io_handler->get_input('smtp_auth', '');
$smtp_user = $this->io_handler->get_input('smtp_user', '');
$smtp_passwd = $this->io_handler->get_input('smtp_pass', '');
$smtp_user = $this->io_handler->get_input('smtp_user', '', true);
$smtp_passwd = $this->io_handler->get_input('smtp_pass', '', true);
$auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP');

View file

@ -79,9 +79,9 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst
$cookie_secure = $this->io_handler->get_input('cookie_secure', $cookie_secure);
$server_protocol = $this->io_handler->get_input('server_protocol', $server_protocol);
$force_server_vars = $this->io_handler->get_input('force_server_vars', 0);
$server_name = $this->io_handler->get_input('server_name', $server_name);
$server_name = $this->io_handler->get_input('server_name', $server_name, true);
$server_port = $this->io_handler->get_input('server_port', $server_port);
$script_path = $this->io_handler->get_input('script_path', $script_path);
$script_path = $this->io_handler->get_input('script_path', $script_path, true);
// Clean up script path
if ($script_path !== '/')

View file

@ -85,10 +85,10 @@ class obtain_update_ftp_data extends task_base
$method = $methods[0];
}
$ftp_host = $this->iohandler->get_input('ftp_host', '');
$ftp_user = $this->iohandler->get_input('ftp_user', '');
$ftp_pass = htmlspecialchars_decode($this->iohandler->get_input('ftp_pass', ''));
$ftp_path = $this->iohandler->get_input('ftp_path', '');
$ftp_host = $this->iohandler->get_input('ftp_host', '', true);
$ftp_user = $this->iohandler->get_input('ftp_user', '', true);
$ftp_pass = htmlspecialchars_decode($this->iohandler->get_input('ftp_pass', '', true));
$ftp_path = $this->iohandler->get_input('ftp_path', '', true);
$ftp_port = $this->iohandler->get_input('ftp_port', 21);
$ftp_time = $this->iohandler->get_input('ftp_timeout', 10);

View file

@ -142,13 +142,16 @@ class report_pm extends \phpbb\notification\type\pm
*/
public function get_email_template_variables()
{
$user_data = $this->user_loader->get_user($this->get_data('reporter_id'));
$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));
return array(
'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
'U_VIEW_REPORT' => generate_board_url() . "mcp.{$this->php_ext}?r={$this->item_parent_id}&amp;i=pm_reports&amp;mode=pm_report_details",
/** @deprecated 3.2.6-RC1 (to be removed in 4.0.0) use {SUBJECT} instead in report_pm.txt */
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&amp;i=pm_reports&amp;mode=pm_report_details",
);
}
@ -236,8 +239,10 @@ class report_pm extends \phpbb\notification\type\pm
*/
public function users_to_query()
{
return array($this->get_data('reporter_id'));
}
return array(
$this->get_data('from_user_id'),
$this->get_data('reporter_id'),
); }
/**
* {@inheritdoc}

View file

@ -46,7 +46,7 @@ class pagination
/**
* Generate a pagination link based on the url and the page information
*
* @param string $base_url is url prepended to all links generated within the function
* @param string|array $base_url is url prepended to all links generated within the function
* If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
* for the page. Also be sure to specify the pagination path information into the start_name argument
* @param string $on_page is the page for which we want to generate the link
@ -69,7 +69,7 @@ class pagination
* set $generate_page_link_override to the new URL value
*
* @event core.pagination_generate_page_link
* @var string base_url is url prepended to all links generated within the function
* @var string|array base_url is url prepended to all links generated within the function
* If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
* for the page. Also be sure to specify the pagination path information into the start_name argument
* @var string on_page is the page for which we want to generate the link
@ -120,7 +120,7 @@ class pagination
* Generate template rendered pagination
* Allows full control of rendering of pagination with the template
*
* @param string $base_url is url prepended to all links generated within the function
* @param string|array $base_url is url prepended to all links generated within the function
* If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
* for the page. Also be sure to specify the pagination path information into the start_name argument
* @param string $block_var_name is the name assigned to the pagination data block within the template (example: <!-- BEGIN pagination -->)
@ -132,7 +132,7 @@ class pagination
* @param int $start the item which should be considered currently active, used to determine the page we're on
* @param bool $reverse_count determines whether we weight display of the list towards the start (false) or end (true) of the list
* @param bool $ignore_on_page decides whether we enable an active (unlinked) item, used primarily for embedded lists
* @return null
* @return void
*/
public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false)
{

View file

@ -354,6 +354,14 @@ class factory implements \phpbb\textformatter\cache_interface
// Load the Emoji plugin and modify its tag's template to obey viewsmilies
$tag = $configurator->Emoji->getTag();
$tag->template = '<xsl:choose>
<xsl:when test="@tseq">
<img alt="{.}" class="emoji" draggable="false" src="//twemoji.maxcdn.com/2/svg/{@tseq}.svg"/>
</xsl:when>
<xsl:otherwise>
<img alt="{.}" class="emoji" draggable="false" src="https://cdn.jsdelivr.net/gh/s9e/emoji-assets-twemoji@11.2/dist/svgz/{@seq}.svgz"/>
</xsl:otherwise>
</xsl:choose>';
$tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';
/**

View file

@ -23,14 +23,16 @@ class link_helper
*
* @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @param \s9e\TextFormatter\Parser $parser Parser
* @return bool Whether the tag is valid
* @return void
*/
public function cleanup_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser)
{
// Invalidate if the content of the tag matches the text attribute
$text = substr($parser->getText(), $tag->getPos(), $tag->getLen());
return ($text !== $tag->getAttribute('text'));
if ($text === $tag->getAttribute('text'))
{
$tag->invalidate();
}
}
/**
@ -40,7 +42,7 @@ class link_helper
*
* @param \s9e\TextFormatter\Parser\Tag $tag URL tag (start tag)
* @param \s9e\TextFormatter\Parser $parser Parser
* @return bool Always true to indicate that the tag is valid
* @return void
*/
public function generate_link_text_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser)
{
@ -49,7 +51,7 @@ class link_helper
// the [url] BBCode when its content is used for the URL
if (!$tag->getEndTag() || !$this->should_shorten($tag, $parser->getText()))
{
return true;
return;
}
// Capture the text between the start tag and its end tag
@ -60,8 +62,6 @@ class link_helper
// Create a tag that consumes the link's text
$parser->addSelfClosingTag('LINK_TEXT', $start, $length)->setAttribute('text', $text);
return true;
}
/**
@ -84,7 +84,7 @@ class link_helper
*
* @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @param string $board_url Forum's root URL (with trailing slash)
* @return bool Always true to indicate that the tag is valid
* @return void
*/
public function truncate_local_url(\s9e\TextFormatter\Parser\Tag $tag, $board_url)
{
@ -93,15 +93,13 @@ class link_helper
{
$tag->setAttribute('text', substr($text, strlen($board_url)));
}
return true;
}
/**
* Truncate the replacement text set in a LINK_TEXT tag
*
* @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @return bool Always true to indicate that the tag is valid
* @return void
*/
public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag)
{
@ -109,10 +107,7 @@ class link_helper
if (utf8_strlen($text) > 55)
{
$text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10);
$tag->setAttribute('text', $text);
}
$tag->setAttribute('text', $text);
return true;
}
}

View file

@ -343,7 +343,7 @@ class user extends \phpbb\session
}
// Is board disabled and user not an admin or moderator?
if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
if ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
{
if ($this->data['is_bot'])
{

View file

@ -9,12 +9,12 @@
ban_give_reason[-1] = '';
<!-- BEGIN bans -->
ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}';
ban_length['{bans.BAN_ID}'] = '{{ bans.A_LENGTH }}';
<!-- IF bans.A_REASON -->
ban_reason['{bans.BAN_ID}'] = '{{ bans.A_REASON | e('js') }}';
ban_reason['{bans.BAN_ID}'] = '{{ bans.REASON | e('js') }}';
<!-- ENDIF -->
<!-- IF bans.A_GIVE_REASON -->
ban_give_reason['{bans.BAN_ID}'] = '{{ bans.A_GIVE_REASON | e('js') }}';
ban_give_reason['{bans.BAN_ID}'] = '{{ bans.GIVE_REASON | e('js') }}';
<!-- ENDIF -->
<!-- END bans -->

View file

@ -108,10 +108,14 @@
</p>
<!-- ENDIF -->
{% EVENT mcp_post_text_before %}
<div id="post_details" class="content post_details">
{POST_PREVIEW}
</div>
{% EVENT mcp_post_text_after %}
<!-- IF S_HAS_ATTACHMENTS -->
<dl class="attachbox">
<dt>{L_ATTACHMENTS}</dt>

View file

@ -12,19 +12,28 @@
<!-- ENDIF -->
{% EVENT memberlist_body_page_header_after %}
<!-- IF S_SHOW_GROUP -->
{% EVENT memberlist_body_group_name_before %}
<h2 class="group-title"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
{% EVENT memberlist_body_group_name_after %}
<!-- IF U_MANAGE -->
<p class="right responsive-center manage rightside"><a href="{U_MANAGE}">{L_MANAGE_GROUP}</a></p>
<!-- ENDIF -->
<p>{GROUP_DESC} {GROUP_TYPE}</p>
{% EVENT memberlist_body_group_desc_after %}
<p>
<!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ENDIF -->
{% EVENT memberlist_body_group_rank_before %}
<!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF -->
<!-- IF GROUP_RANK -->{GROUP_RANK}<!-- ENDIF -->
{% EVENT memberlist_body_group_rank_after %}
</p>
<!-- ELSE -->
{% EVENT memberlist_body_page_title_before %}
<h2 class="solo">{PAGE_TITLE}<!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
<div class="action-bar bar-top">
@ -60,6 +69,7 @@
<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"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th>
<!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF -->
{% EVENT memberlist_body_memberlist_after %}
</tr>
</thead>
<tbody>
@ -91,12 +101,14 @@
<th class="info">{% for field in custom_fields %}{% if not loop.first %}{L_COMMA_SEPARATOR} {% endif %}{{ field.PROFILE_FIELD_NAME }}{% endfor %}</th>
<th class="joined"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th>
<!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF -->
{% EVENT memberlist_body_leaders_set_after %}
<!-- ELSEIF S_SHOW_GROUP -->
<th class="name">{L_GROUP_MEMBERS}</th>
<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 -->
{% EVENT memberlist_body_show_group_after %}
<!-- ENDIF -->
</tr>
</thead>
@ -111,6 +123,7 @@
<td class="info"><!-- BEGIN custom_fields --><div>{memberrow.custom_fields.PROFILE_FIELD_VALUE}</div><!-- BEGINELSE -->&nbsp;<!-- END custom_fields --></td>
<td>{memberrow.JOINED}</td>
<!-- IF S_VIEWONLINE --><td>{memberrow.LAST_ACTIVE}&nbsp;</td><!-- ENDIF -->
{% EVENT memberlist_body_memberrow_after %}
</tr>
<!-- BEGINELSE -->
<tr class="bg1">
@ -156,6 +169,8 @@
</div>
</div>
{% EVENT memberlist_body_page_footer_before %}
<!-- IF S_IN_SEARCH_POPUP -->
<!-- INCLUDE simple_footer.html -->
<!-- ELSE -->

View file

@ -179,17 +179,18 @@
<ul id="nav-breadcrumbs" class="nav-breadcrumbs linklist navlinks" role="menubar">
<!-- DEFINE $MICRODATA = ' itemtype="http://schema.org/ListItem" itemprop="itemListElement" itemscope' -->
{% set navlink_position = 1 %}
<!-- EVENT overall_header_breadcrumbs_before -->
<li class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">
<!-- IF U_SITE_HOME -->
<span class="crumb" {$MICRODATA}><a href="{U_SITE_HOME}" itemprop="url" data-navbar-reference="home"><i class="icon fa-home fa-fw" aria-hidden="true"></i><span itemprop="title">{L_SITE_HOME}</span></a></span>
<span class="crumb" {$MICRODATA}><a href="{U_SITE_HOME}" itemtype="https://schema.org/Thing" itemprop="item" data-navbar-reference="home"><i class="icon fa-home fa-fw" aria-hidden="true"></i><span itemprop="name">{L_SITE_HOME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span>
<!-- ENDIF -->
<!-- EVENT overall_header_breadcrumb_prepend -->
<span class="crumb" {$MICRODATA}><a href="{U_INDEX}" itemprop="url" accesskey="h" data-navbar-reference="index"><!-- IF not U_SITE_HOME --><i class="icon fa-home fa-fw"></i><!-- ENDIF --><span itemprop="title">{L_INDEX}</span></a></span>
<span class="crumb" {$MICRODATA}><a href="{U_INDEX}" itemtype="https://schema.org/Thing" itemprop="item" accesskey="h" data-navbar-reference="index"><!-- IF not U_SITE_HOME --><i class="icon fa-home fa-fw"></i><!-- ENDIF --><span itemprop="name">{L_INDEX}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span>
<!-- BEGIN navlinks -->
<!-- EVENT overall_header_navlink_prepend -->
<span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemprop="url"><span itemprop="title">{navlinks.FORUM_NAME}</span></a></span>
<span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemtype="https://schema.org/Thing" itemprop="item"><span itemprop="name">{navlinks.FORUM_NAME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span>
<!-- EVENT overall_header_navlink_append -->
<!-- END navlinks -->
<!-- EVENT overall_header_breadcrumb_append -->

View file

@ -46,6 +46,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
$config = $this->config = new \phpbb\config\config(array(
'img_min_thumb_filesize' => 2,
'img_max_thumb_width' => 2,
'upload_path' => 'files',
));
$this->db = $this->db = $this->new_dbal();
@ -63,8 +64,8 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
)));
$this->application = new Application();
$this->application->add(new generate($this->user, $this->db, $this->cache, $this->phpbb_root_path, $this->phpEx));
$this->application->add(new delete($this->user, $this->db, $this->phpbb_root_path));
$this->application->add(new generate($config, $this->user, $this->db, $this->cache, $this->phpbb_root_path, $this->phpEx));
$this->application->add(new delete($config, $this->user, $this->db, $this->phpbb_root_path));
$this->application->add(new recreate($this->user));
$phpbb_filesystem = new \phpbb\filesystem\filesystem();

View file

@ -98,6 +98,8 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
$phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
$phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
$phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications');
parent::setUp();
}

View file

@ -86,6 +86,8 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
$phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens');
$phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
$phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
$phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications');
}
public function test_user_delete()

View file

@ -49,6 +49,8 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
$phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens');
$phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
$phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
$phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications');
}
public function first_last_post_data()

View file

@ -67,6 +67,12 @@ class phpbb_lint_test extends phpbb_test_case
{
$files = array();
$dh = opendir($root);
if ($dh === false)
{
return $files;
}
while (($filename = readdir($dh)) !== false)
{
if ($filename == '.' || $filename == '..')
@ -89,6 +95,7 @@ class phpbb_lint_test extends phpbb_test_case
// PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20
// https://gist.github.com/e003913ffd493da63cbc
dirname(__FILE__) . '/../phpBB/vendor',
dirname(__FILE__) . '/../node_modules',
)))
{
$files = array_merge($files, $this->check($path));

View file

@ -38,7 +38,7 @@ class phpbb_network_checkdnsrr_test extends phpbb_test_case
array('does-not-exist.phpbb.com', 'AAAA', false),
// Existing CNAME record
array('news.cnet.com', 'CNAME', true),
array('area51.phpbb.com', 'CNAME', true),
// Non-existing CNAME record
array('does-not-exist.phpbb.com', 'CNAME', false),

View file

@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
),
array(
"Emoji: \xF0\x9F\x98\x80",
'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f600.png">'
'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//twemoji.maxcdn.com/2/svg/1f600.svg">'
),
array(
"Emoji: \xF0\x9F\x98\x80",

View file

@ -1 +1 @@
<img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f197.png">
<img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//twemoji.maxcdn.com/2/svg/1f197.svg">

View file

@ -79,7 +79,7 @@ class phpbb_filespec_test extends phpbb_test_case
$this->phpbb_root_path = $phpbb_root_path;
}
private function set_reflection_property(&$class, $property_name, $value)
private function set_reflection_property($class, $property_name, $value)
{
$property = new ReflectionProperty($class, $property_name);
$property->setAccessible(true);

View file

@ -12,7 +12,7 @@ set -e
set -x
# MariaDB Series
VERSION='5.5'
VERSION='10.0'
# Operating system codename, e.g. "precise"
OS_CODENAME=$(lsb_release --codename --short)

View file

@ -46,13 +46,26 @@ php_ini_file=$(find_php_ini)
if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ]
then
echo 'Enabling APC PHP extension'
register_php_extension 'apc' "$php_ini_file"
printf "\n" | pecl install apc
echo 'apc.enable_cli=1' >> "$php_ini_file"
else
echo 'Disabling Opcache'
echo 'opcache.enable=0' >> "$php_ini_file"
fi
# APCu
if [ `php -r "echo (int) (version_compare(PHP_VERSION, '7.0.0-dev', '>=') && version_compare(PHP_VERSION, '7.3.0-dev', '<'));"` == "1" ]
then
if ! [ "$(pecl info pecl/apcu)" ]
then
echo 'Enabling APCu PHP extension'
printf "\n" | pecl install apcu
echo 'apc.enabled=1' >> "$php_ini_file"
echo 'apc.enable_cli=1' >> "$php_ini_file"
fi
fi
# redis
# Disabled redis for now as it causes travis to fail
# git clone git://github.com/nicolasff/phpredis.git redis

View file

@ -19,7 +19,8 @@ sudo service nginx stop
DIR=$(dirname "$0")
USER=$(whoami)
PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB")
NGINX_CONF="/etc/nginx/sites-enabled/default"
NGINX_SITE_CONF="/etc/nginx/sites-enabled/default"
NGINX_CONF="/etc/nginx/nginx.conf"
APP_SOCK=$(realpath "$DIR")/php-app.sock
# php-fpm
@ -50,6 +51,7 @@ cat $DIR/../phpBB/docs/nginx.sample.conf \
| sed -e '/If running php as fastcgi/,$d' \
| sed -e "s/fastcgi_pass php;/fastcgi_pass unix:$(echo $APP_SOCK | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g');/g" \
| sed -e 's/#listen 80/listen 80/' \
| sudo tee $NGINX_CONF
| sudo tee $NGINX_SITE_CONF
sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF
sudo service nginx start