mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-14 04:30:29 +01:00
Merge branch 'prep-release-3.2.5' into 3.2.x
This commit is contained in:
commit
70a56c208f
@ -3,8 +3,8 @@
|
||||
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
|
||||
<!-- a few settings for the build -->
|
||||
<property name="newversion" value="3.2.6-dev" />
|
||||
<property name="prevversion" value="3.2.4" />
|
||||
<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="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, 3.2.4" />
|
||||
<!-- no configuration should be needed beyond this point -->
|
||||
|
||||
<property name="oldversions" value="${olderversions}, ${prevversion}" />
|
||||
|
@ -20,6 +20,13 @@ var phpbbAlertTimer = null;
|
||||
|
||||
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
|
||||
*
|
||||
|
9
phpBB/assets/javascript/jquery.min.js
vendored
9
phpBB/assets/javascript/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@ -50,6 +50,7 @@
|
||||
<ol>
|
||||
<li><a href="#changelog">Changelog</a>
|
||||
<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="#v323">Changes since 3.2.3</a></li>
|
||||
@ -134,6 +135,18 @@
|
||||
<div class="inner">
|
||||
|
||||
<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>
|
||||
|
@ -1762,13 +1762,14 @@ class bitfield
|
||||
/**
|
||||
* Formats the quote according to the given BBCode status setting
|
||||
*
|
||||
* @param bool $bbcode_status The status of the BBCode setting
|
||||
* @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 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 array $quote_attributes The attributes of the 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)
|
||||
{
|
||||
@ -1794,7 +1795,7 @@ function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_u
|
||||
$message = $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)
|
||||
|
@ -666,8 +666,29 @@ function user_delete($mode, $user_ids, $retain_username = true)
|
||||
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
|
||||
foreach ($table_ary as $table)
|
||||
{
|
||||
@ -675,6 +696,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
|
||||
WHERE " . $user_id_sql;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$db->sql_return_on_error();
|
||||
|
||||
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
||||
|
||||
|
@ -986,7 +986,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
$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)
|
||||
|
@ -23,7 +23,7 @@ if (php_sapi_name() !== 'cli')
|
||||
define('IN_PHPBB', true);
|
||||
define('IN_INSTALL', true);
|
||||
define('PHPBB_ENVIRONMENT', 'production');
|
||||
define('PHPBB_VERSION', '3.2.5-RC1');
|
||||
define('PHPBB_VERSION', '3.2.5');
|
||||
$phpbb_root_path = __DIR__ . '/../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
|
||||
|
@ -54,7 +54,7 @@ $lang = array_merge($lang, array(
|
||||
|
||||
<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',
|
||||
|
@ -58,9 +58,14 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
$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
|
||||
// in the update package if we're updating to 3.0.8-RC1 or later,
|
||||
|
37
phpBB/phpbb/db/migration/data/v32x/jquery_update.php
Normal file
37
phpBB/phpbb/db/migration/data/v32x/jquery_update.php
Normal 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')),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
38
phpBB/phpbb/db/migration/data/v32x/v325.php
Normal file
38
phpBB/phpbb/db/migration/data/v32x/v325.php
Normal 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')),
|
||||
);
|
||||
}
|
||||
}
|
@ -65,7 +65,7 @@ class email extends \phpbb\notification\method\messenger_base
|
||||
*/
|
||||
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']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -846,6 +846,7 @@ if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_
|
||||
load_drafts($topic_id, $forum_id);
|
||||
}
|
||||
|
||||
/** @var \phpbb\textformatter\utils_interface $bbcode_utils */
|
||||
$bbcode_utils = $phpbb_container->get('text_formatter.utils');
|
||||
|
||||
if ($submit || $preview || $refresh)
|
||||
@ -1648,7 +1649,9 @@ if ($generate_quote)
|
||||
'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)
|
||||
|
57
tests/functions_content/phpbb_format_quote_test.php
Normal file
57
tests/functions_content/phpbb_format_quote_test.php
Normal 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="username"]quoted[/quote]', '', "[quote=admin user_id=2][quote="username"]quoted[/quote][/quote]\n\n"],
|
||||
[false, ['author' => 'admin', 'user_id' => 2], '[quote="username"]quoted[/quote]', '', "admin wrote:\n> [quote="username"]quoted[/quote]\n"],
|
||||
[true, ['author' => 'admin', 'user_id' => 2], '[quote="username"]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="username"]quoted[/quote][/quote]\n\n"],
|
||||
[false, ['author' => 'admin', 'user_id' => 2], '[quote="username"]quoted[/quote]', "http://viewtopic.php?p=1#p1 - Subject: Foo\n\n", "http://viewtopic.php?p=1#p1 - Subject: Foo\n\nadmin wrote:\n> [quote="username"]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);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user