Merge pull request #1 from phpbb/3.2.x

3.2.x
This commit is contained in:
3Di 2018-12-24 09:42:16 +01:00 committed by GitHub
commit 871875d9aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 301 additions and 33 deletions

View file

@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../"> <project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build --> <!-- a few settings for the build -->
<property name="newversion" value="3.2.5-dev" /> <property name="newversion" value="3.2.6-dev" />
<property name="prevversion" value="3.2.4" /> <property name="prevversion" value="3.2.5" />
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.2, 3.2.3" /> <property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4" />
<!-- no configuration should be needed beyond this point --> <!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" /> <property name="oldversions" value="${olderversions}, ${prevversion}" />

View file

@ -20,6 +20,13 @@ var phpbbAlertTimer = null;
phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined'); phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
// Add ajax pre-filter to prevent cross-domain script execution
$.ajaxPrefilter(function(s) {
if (s.crossDomain) {
s.contents.script = false;
}
});
/** /**
* Display a loading screen * Display a loading screen
* *

File diff suppressed because one or more lines are too long

View file

@ -50,6 +50,8 @@
<ol> <ol>
<li><a href="#changelog">Changelog</a> <li><a href="#changelog">Changelog</a>
<ul> <ul>
<li><a href="#v325rc1">Changes since 3.2.5-RC1</a></li>
<li><a href="#v324">Changes since 3.2.4</a></li>
<li><a href="#v324rc1">Changes since 3.2.4-RC1</a></li> <li><a href="#v324rc1">Changes since 3.2.4-RC1</a></li>
<li><a href="#v323">Changes since 3.2.3</a></li> <li><a href="#v323">Changes since 3.2.3</a></li>
<li><a href="#v323rc2">Changes since 3.2.3-RC2</a></li> <li><a href="#v323rc2">Changes since 3.2.3-RC2</a></li>
@ -133,6 +135,40 @@
<div class="inner"> <div class="inner">
<div class="content"> <div class="content">
<a name="v325rc1"></a><h3>Changes since 3.2.5-RC1</h3>
<h4>Bug</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15888">PHPBB3-15888</a>] - Update link to user guide</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15893">PHPBB3-15893</a>] - Call to undefined $user in phpbb_format_quote() when BBCodes are disabled</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15911">PHPBB3-15911</a>] - SQL general error on DB update from 3.0 branch</li>
</ul>
<h4>Hardening</h4>
<ul>
<li>[SECURITY-229] - Update to latest version of jQuery 1.x and add ajax prefilter</li>
</ul>
<a name="v324"></a><h3>Changes since 3.2.4</h3>
<h4>Bug</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15665">PHPBB3-15665</a>] - MSSQL implementation crashes when upload directory &gt; 2GB</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15858">PHPBB3-15858</a>] - Unapproved User(s) appearing as Guest in Team Page.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15867">PHPBB3-15867</a>] - Contact form without class</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15871">PHPBB3-15871</a>] - PHP 7.1+ warning in ACP extensions module</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15875">PHPBB3-15875</a>] - BBCode parsing error (PHP fatal error)</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15881">PHPBB3-15881</a>] - Login keys are not reset after password update in some cases</li>
</ul>
<h4>Improvement</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15542">PHPBB3-15542</a>] - Some JS files being called without assets version</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15859">PHPBB3-15859</a>] - Modify the topic ordering if needed</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15863">PHPBB3-15863</a>] - Modify the topic sort ordering from the beginning</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15870">PHPBB3-15870</a>] - Modify the forum ID to handle the correct display of viewtopic if needed</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15872">PHPBB3-15872</a>] - Add show_user_activity to display_user_activity_modify_actives</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15873">PHPBB3-15873</a>] - Event to add/modify MCP report details template data.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15878">PHPBB3-15878</a>] - Add attachment to core.ucp_pm_view_message</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15879">PHPBB3-15879</a>] - Modify attachment's poster_id for get_submitted_attachment_data</li>
</ul>
<a name="v324rc1"></a><h3>Changes since 3.2.4-RC1</h3> <a name="v324rc1"></a><h3>Changes since 3.2.4-RC1</h3>
<h4>Bug</h4> <h4>Bug</h4>
<ul> <ul>

View file

@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
*/ */
// phpBB Version // phpBB Version
@define('PHPBB_VERSION', '3.2.5-dev'); @define('PHPBB_VERSION', '3.2.6-dev');
// QA-related // QA-related
// define('PHPBB_QA', 1); // define('PHPBB_QA', 1);

View file

@ -1762,13 +1762,14 @@ class bitfield
/** /**
* Formats the quote according to the given BBCode status setting * Formats the quote according to the given BBCode status setting
* *
* @param phpbb\language\language $language Language class
* @param parse_message $message_parser Message parser class
* @param phpbb\textformatter\utils_interface $text_formatter_utils Text formatter utilities
* @param bool $bbcode_status The status of the BBCode setting * @param bool $bbcode_status The status of the BBCode setting
* @param array $quote_attributes The attributes of the quoted post * @param array $quote_attributes The attributes of the quoted post
* @param phpbb\textformatter\utils $text_formatter_utils Text formatter utilities
* @param parse_message $message_parser Message parser class
* @param string $message_link Link of the original quoted post * @param string $message_link Link of the original quoted post
*/ */
function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '') function phpbb_format_quote($language, $message_parser, $text_formatter_utils, $bbcode_status, $quote_attributes, $message_link = '')
{ {
if ($bbcode_status) if ($bbcode_status)
{ {
@ -1794,7 +1795,7 @@ function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_u
$message = $quote_string . $message; $message = $quote_string . $message;
$message = str_replace("\n", "\n" . $quote_string, $message); $message = str_replace("\n", "\n" . $quote_string, $message);
$message_parser->message = $quote_attributes['author'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; $message_parser->message = $quote_attributes['author'] . " " . $language->lang('WROTE') . ":\n" . $message . "\n";
} }
if ($message_link) if ($message_link)

View file

@ -1241,6 +1241,7 @@ function display_user_activity(&$userdata_ary)
} }
$userdata = $userdata_ary; $userdata = $userdata_ary;
$show_user_activity = true;
/** /**
* Alter list of forums and topics to display as active * Alter list of forums and topics to display as active
* *
@ -1248,9 +1249,11 @@ function display_user_activity(&$userdata_ary)
* @var array userdata User's data * @var array userdata User's data
* @var array active_f_row List of active forums * @var array active_f_row List of active forums
* @var array active_t_row List of active posts * @var array active_t_row List of active posts
* @var bool show_user_activity Show user forum and topic activity
* @since 3.1.0-RC3 * @since 3.1.0-RC3
* @changed 3.2.5-RC1 Added show_user_activity into event
*/ */
$vars = array('userdata', 'active_f_row', 'active_t_row'); $vars = array('userdata', 'active_f_row', 'active_t_row', 'show_user_activity');
extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars)));
$userdata_ary = $userdata; $userdata_ary = $userdata;
unset($userdata); unset($userdata);
@ -1287,7 +1290,7 @@ function display_user_activity(&$userdata_ary)
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct), 'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id), 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id),
'S_SHOW_ACTIVITY' => true) 'S_SHOW_ACTIVITY' => $show_user_activity)
); );
} }

View file

@ -666,8 +666,29 @@ function user_delete($mode, $user_ids, $retain_username = true)
delete_posts('poster_id', $user_ids); delete_posts('poster_id', $user_ids);
} }
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE, $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')); $table_ary = [
USERS_TABLE,
USER_GROUP_TABLE,
TOPICS_WATCH_TABLE,
FORUMS_WATCH_TABLE,
ACL_USERS_TABLE,
TOPICS_TRACK_TABLE,
TOPICS_POSTED_TABLE,
FORUMS_TRACK_TABLE,
PROFILE_FIELDS_DATA_TABLE,
MODERATOR_CACHE_TABLE,
DRAFTS_TABLE,
BOOKMARKS_TABLE,
SESSIONS_KEYS_TABLE,
PRIVMSGS_FOLDER_TABLE,
PRIVMSGS_RULES_TABLE,
$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')
];
// Ignore errors on deleting from non-existent tables, e.g. when migrating
$db->sql_return_on_error(true);
// Delete the miscellaneous (non-post) data for the user // Delete the miscellaneous (non-post) data for the user
foreach ($table_ary as $table) foreach ($table_ary as $table)
{ {
@ -675,6 +696,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
WHERE " . $user_id_sql; WHERE " . $user_id_sql;
$db->sql_query($sql); $db->sql_query($sql);
} }
$db->sql_return_on_error();
$cache->destroy('sql', MODERATOR_CACHE_TABLE); $cache->destroy('sql', MODERATOR_CACHE_TABLE);

View file

@ -986,7 +986,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$quote_attributes['post_id'] = $post['msg_id']; $quote_attributes['post_id'] = $post['msg_id'];
} }
phpbb_format_quote($bbcode_status, $quote_attributes, $phpbb_container->get('text_formatter.utils'), $message_parser, $message_link); /** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');
/** @var \phpbb\textformatter\utils_interface $text_formatter_utils */
$text_formatter_utils = $phpbb_container->get('text_formatter.utils');
phpbb_format_quote($language, $message_parser, $text_formatter_utils, $bbcode_status, $quote_attributes, $message_link);
} }
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)

View file

@ -296,7 +296,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
* @var array cp_row Array with senders custom profile field data * @var array cp_row Array with senders custom profile field data
* @var array msg_data Template array with message data * @var array msg_data Template array with message data
* @var array user_info User data of the sender * @var array user_info User data of the sender
* @var array attachments Attachments data
* @since 3.2.2-RC1 * @since 3.2.2-RC1
* @changed 3.2.5-RC1 Added attachments
*/ */
$vars = array( $vars = array(
'id', 'id',
@ -308,6 +310,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'cp_row', 'cp_row',
'msg_data', 'msg_data',
'user_info', 'user_info',
'attachments',
); );
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_message', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_message', compact($vars)));

View file

@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$convertor_data = array( $convertor_data = array(
'forum_name' => 'phpBB 2.0.x', 'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3', 'version' => '1.0.3',
'phpbb_version' => '3.2.4', 'phpbb_version' => '3.2.5',
'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>', 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>',
'dbms' => $dbms, 'dbms' => $dbms,
'dbhost' => $dbhost, 'dbhost' => $dbhost,

View file

@ -23,7 +23,7 @@ if (php_sapi_name() !== 'cli')
define('IN_PHPBB', true); define('IN_PHPBB', true);
define('IN_INSTALL', true); define('IN_INSTALL', true);
define('PHPBB_ENVIRONMENT', 'production'); define('PHPBB_ENVIRONMENT', 'production');
define('PHPBB_VERSION', '3.2.4'); define('PHPBB_VERSION', '3.2.5');
$phpbb_root_path = __DIR__ . '/../'; $phpbb_root_path = __DIR__ . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1); $phpEx = substr(strrchr(__FILE__, '.'), 1);

View file

@ -279,7 +279,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.5-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.6-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');

View file

@ -54,7 +54,7 @@ $lang = array_merge($lang, array(
<br /> <br />
<p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.1/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p> <p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p>
', ',
'ACL_NEVER' => 'Never', 'ACL_NEVER' => 'Never',

View file

@ -173,7 +173,7 @@ switch ($mode)
'LEFT_JOIN' => array( 'LEFT_JOIN' => array(
array( array(
'FROM' => array(USERS_TABLE => 'u'), 'FROM' => array(USERS_TABLE => 'u'),
'ON' => 'ug.user_id = u.user_id AND ug.user_pending = 0', 'ON' => 'ug.user_id = u.user_id',
), ),
array( array(
'FROM' => array(GROUPS_TABLE => 'g'), 'FROM' => array(GROUPS_TABLE => 'g'),
@ -181,7 +181,7 @@ switch ($mode)
), ),
), ),
'WHERE' => $db->sql_in_set('g.group_id', $group_ids, false, true), 'WHERE' => $db->sql_in_set('g.group_id', $group_ids, false, true) . ' AND ug.user_pending = 0',
'ORDER_BY' => 'u.username_clean ASC', 'ORDER_BY' => 'u.username_clean ASC',
); );

View file

@ -58,9 +58,14 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$extension_groups_updated = array(); $extension_groups_updated = array();
while ($lang_dir = $this->db->sql_fetchfield('lang_dir')) while ($row = $this->db->sql_fetchrow($result))
{ {
$lang_dir = basename($lang_dir); if (empty($row['lang_dir']))
{
continue;
}
$lang_dir = basename($row['lang_dir']);
// The language strings we need are either in language/.../acp/attachments.php // The language strings we need are either in language/.../acp/attachments.php
// in the update package if we're updating to 3.0.8-RC1 or later, // in the update package if we're updating to 3.0.8-RC1 or later,

View file

@ -0,0 +1,37 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v32x;
class jquery_update extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return $this->config['load_jquery_url'] === '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js';
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v32x\v325rc1',
);
}
public function update_data()
{
return array(
array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')),
);
}
}

View file

@ -0,0 +1,38 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v32x;
class v325 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return phpbb_version_compare($this->config['version'], '3.2.5', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v32x\v325rc1',
'\phpbb\db\migration\data\v32x\jquery_update',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.5')),
);
}
}

View file

@ -0,0 +1,36 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v32x;
class v325rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return phpbb_version_compare($this->config['version'], '3.2.5-RC1', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v32x\v324',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.5-RC1')),
);
}
}

View file

@ -65,7 +65,7 @@ class email extends \phpbb\notification\method\messenger_base
*/ */
public function is_available(type_interface $notification_type = null) public function is_available(type_interface $notification_type = null)
{ {
return parent::is_available($notification_type) && $this->config['email_enable'] && $this->user->data['user_email']; return parent::is_available($notification_type) && $this->config['email_enable'] && !empty($this->user->data['user_email']);
} }
/** /**

View file

@ -201,7 +201,8 @@ class context
$pos = strpos($blocks[$i], '['); $pos = strpos($blocks[$i], '[');
$name = ($pos !== false) ? substr($blocks[$i], 0, $pos) : $blocks[$i]; $name = ($pos !== false) ? substr($blocks[$i], 0, $pos) : $blocks[$i];
$block = &$block[$name]; $block = &$block[$name];
$index = (!$pos || strpos($blocks[$i], '[]') === $pos) ? (count($block) - 1) : (min((int) substr($blocks[$i], $pos + 1, -1), count($block) - 1)); $block_count = empty($block) ? 0 : count($block) - 1;
$index = (!$pos || strpos($blocks[$i], '[]') === $pos) ? $block_count : (min((int) substr($blocks[$i], $pos + 1, -1), $block_count));
$block = &$block[$index]; $block = &$block[$index];
} }

View file

@ -597,6 +597,20 @@ if (isset($post_data['post_text']))
// Set some default variables // Set some default variables
$uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'post_subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0); $uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'post_subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0);
/**
* This event allows you to modify the default variables for post_data, and unset them in post_data if needed
*
* @event core.posting_modify_default_variables
* @var array post_data Array with post data
* @var array uninit Array with default vars to put into post_data, if they aren't there
* @since 3.2.5-RC1
*/
$vars = array(
'post_data',
'uninit',
);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_default_variables', compact($vars)));
foreach ($uninit as $var_name => $default_value) foreach ($uninit as $var_name => $default_value)
{ {
if (!isset($post_data[$var_name])) if (!isset($post_data[$var_name]))
@ -832,6 +846,7 @@ if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_
load_drafts($topic_id, $forum_id); load_drafts($topic_id, $forum_id);
} }
/** @var \phpbb\textformatter\utils_interface $bbcode_utils */
$bbcode_utils = $phpbb_container->get('text_formatter.utils'); $bbcode_utils = $phpbb_container->get('text_formatter.utils');
if ($submit || $preview || $refresh) if ($submit || $preview || $refresh)
@ -1634,7 +1649,9 @@ if ($generate_quote)
'user_id' => $post_data['poster_id'], 'user_id' => $post_data['poster_id'],
); );
phpbb_format_quote($config['allow_bbcode'], $quote_attributes, $bbcode_utils, $message_parser); /** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');
phpbb_format_quote($language, $message_parser, $bbcode_utils, $bbcode_status, $quote_attributes);
} }
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh) if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)

View file

@ -21,8 +21,8 @@
# General Information about this style # General Information about this style
name = prosilver name = prosilver
copyright = © phpBB Limited, 2007 copyright = © phpBB Limited, 2007
style_version = 3.2.4 style_version = 3.2.5
phpbb_version = 3.2.4 phpbb_version = 3.2.5
# Defining a different template bitfield # Defining a different template bitfield
# template_bitfield = //g= # template_bitfield = //g=

View file

@ -77,7 +77,7 @@
<dl> <dl>
<dt><label for="message">{L_MESSAGE_BODY}{L_COLON}</label><br /> <dt><label for="message">{L_MESSAGE_BODY}{L_COLON}</label><br />
<span>{L_EMAIL_BODY_EXPLAIN}</span></dt> <span>{L_EMAIL_BODY_EXPLAIN}</span></dt>
<dd><textarea name="message" id="message" rows="15" cols="76" tabindex="4">{MESSAGE}</textarea></dd> <dd><textarea class="inputbox" name="message" id="message" rows="15" cols="76" tabindex="4">{MESSAGE}</textarea></dd>
</dl> </dl>
<!-- IF S_REGISTERED_USER --> <!-- IF S_REGISTERED_USER -->
<dl> <dl>

View file

@ -0,0 +1,57 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
class phpbb_functions_content_phpbb_format_quote_test extends phpbb_test_case
{
/** @var \phpbb\language\language */
protected $lang;
public function setUp()
{
global $cache, $user, $phpbb_root_path, $phpEx;
$lang_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
$this->lang = new \phpbb\language\language($lang_file_loader);
$user = new \phpbb\user($this->lang, '\phpbb\datetime');
$cache = new phpbb_mock_cache();
parent::setUp();
}
public function data_phpbb_format_quote()
{
return [
[true, ['author' => 'admin', 'user_id' => 2], '[quote=&quot;username&quot;]quoted[/quote]', '', "[quote=admin user_id=2][quote=&quot;username&quot;]quoted[/quote][/quote]\n\n"],
[false, ['author' => 'admin', 'user_id' => 2], '[quote=&quot;username&quot;]quoted[/quote]', '', "admin wrote:\n&gt; [quote=&quot;username&quot;]quoted[/quote]\n"],
[true, ['author' => 'admin', 'user_id' => 2], '[quote=&quot;username&quot;]quoted[/quote]', "[url=http://viewtopic.php?p=1#p1]Subject: Foo[/url]\n\n", "[url=http://viewtopic.php?p=1#p1]Subject: Foo[/url]\n\n[quote=admin user_id=2][quote=&quot;username&quot;]quoted[/quote][/quote]\n\n"],
[false, ['author' => 'admin', 'user_id' => 2], '[quote=&quot;username&quot;]quoted[/quote]', "http://viewtopic.php?p=1#p1 - Subject: Foo\n\n", "http://viewtopic.php?p=1#p1 - Subject: Foo\n\nadmin wrote:\n&gt; [quote=&quot;username&quot;]quoted[/quote]\n"],
];
}
/**
* @dataProvider data_phpbb_format_quote
*/
public function test_phpbb_format_quote($bbcode_status, $quote_attributes, $message, $message_link, $expected)
{
$text_formatter_utils = new \phpbb\textformatter\s9e\utils();
$message_parser = new parse_message($message);
phpbb_format_quote($this->lang, $message_parser, $text_formatter_utils, $bbcode_status, $quote_attributes, $message_link);
$this->assertEquals($expected, $message_parser->message);
}
}