Skip to content

Commit 655b98b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5cd4ff6 + 3dc1e6f commit 655b98b

File tree

173 files changed

+6798
-4311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+6798
-4311
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ jobs:
503503
uses: shivammathur/setup-php@v2
504504
with:
505505
php-version: ${{ matrix.php }}
506-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql
506+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql, sodium
507507
ini-values: upload_tmp_dir=${{ runner.temp }}, sys_temp_dir=${{ runner.temp }}
508508
coverage: none
509509

SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
Please do not post potential security vulnerabilities publicly. Instead, report them to the phpBB team.
6+
We take security very seriously and will respond to reports about potential security vulnerabilities as quickly as possible.
7+
There are multiple ways a potential security vulnerability can be reported:
8+
9+
- HackerOne: [phpBB | Vulnerability Disclosure Program | HackerOne](https://hackerone.com/phpbb)
10+
- Create a report in the security tracker: [Security Tracker](https://www.phpbb.com/security/)
11+
- Send an email: [security@phpbb.com](mailto:security@phpbb.com)
12+
13+
Please provide as much detail as possible when reporting a vulnerability. You can expect to receive an update on your report within a few days. If the vulnerability is accepted, we will work on a fix and keep you informed of the progress. If the vulnerability is declined, we will provide an explanation.

Vagrantfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ aliasesPath = "vagrant/aliases"
1111
require File.expand_path(confDir + '/scripts/homestead.rb')
1212

1313
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
14-
if File.exists? aliasesPath then
14+
if File.exist? aliasesPath then
1515
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
1616
end
1717

18-
if File.exists? homesteadYamlPath then
18+
if File.exist? homesteadYamlPath then
1919
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
2020
end
2121

22-
if File.exists? afterScriptPath then
22+
if File.exist? afterScriptPath then
2323
config.vm.provision "shell", path: afterScriptPath
2424
end
2525
end

build/build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
44
<!-- a few settings for the build -->
55
<property name="newversion" value="4.0.0-a1-dev" />
6-
<property name="prevversion" value="3.3.14" />
7-
<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, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.3.10, 3.3.11, 3.3.12, 3.3.13" />
6+
<property name="prevversion" value="3.3.15" />
7+
<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, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.3.10, 3.3.11, 3.3.12, 3.3.13, 3.3.14" />
88
<!-- no configuration should be needed beyond this point -->
99

1010
<property name="oldversions" value="${olderversions}, ${prevversion}" />

build/psalm_bootstrap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
require_once $phpbb_root_path . 'includes/functions_content.' . $phpEx;
3434
require_once $phpbb_root_path . 'includes/functions_display.' . $phpEx;
3535
require_once $phpbb_root_path . 'includes/functions_mcp.' . $phpEx;
36-
require_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
3736
require_once $phpbb_root_path . 'includes/functions_module.' . $phpEx;
3837
require_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
3938
require_once $phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx;

phpBB/adm/style/acp_bbcodes.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>{L_ACP_BBCODES}</h1>
1414

1515
<fieldset>
1616
<legend>{L_BBCODE_USAGE}</legend>
17-
<p>{L_BBCODE_USAGE_EXPLAIN}</p>
17+
<p>{{ lang('BBCODE_USAGE_EXPLAIN', '<a href="#down">', '</a>') }}</p>
1818
<dl>
1919
<dt><label for="bbcode_match">{L_EXAMPLES}</label><br /><br /><span>{L_BBCODE_USAGE_EXAMPLE}</span></dt>
2020
<dd><textarea id="bbcode_match" name="bbcode_match" cols="60" rows="5">{BBCODE_MATCH}</textarea></dd>
@@ -47,6 +47,17 @@ <h1>{L_ACP_BBCODES}</h1>
4747
</dl>
4848
</fieldset>
4949

50+
<fieldset>
51+
<legend>{{ lang('APPEARANCE') }}</legend>
52+
<dl>
53+
<dt><label for="bbcode_font_icon">{{ lang('BBCODE_FONT_ICON') }}</label><br><span>{{ lang('BBCODE_FONT_ICON_EXPLAIN', '<a href="https://fontawesome.com/v6/icons/" target="_blank">', '</a>') }}</span></dt>
54+
<dd>
55+
<input type="text" name="bbcode_font_icon" id="bbcode_font_icon" value="{{ BBCODE_FONT_ICON }}" />
56+
{{ Icon('font', ' ', '', false, '', {'id':'bbcode_icon_preview'}) }}
57+
</dd>
58+
</dl>
59+
</fieldset>
60+
5061
<!-- EVENT acp_bbcodes_edit_fieldsets_after -->
5162

5263
<fieldset class="submit-buttons">

phpBB/adm/style/acp_storage.html

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h3>{{ lang('WARNING') }}</h3>
4747
{% for provider in PROVIDERS %}
4848
{% if provider.is_available %}
4949
<option value="{{ get_class(provider) }}"{{ attribute(config, 'storage\\' ~ storage.get_name ~ '\\provider') == get_class(provider) ? ' selected' : '' }} data-toggle-setting="#{{ storage.get_name }}_{{ provider.get_name }}_settings">
50-
{{ lang('STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_NAME') }}
50+
{{ provider.get_title }}
5151
</option>
5252
{% endif %}
5353
{% endfor %}
@@ -59,43 +59,42 @@ <h3>{{ lang('WARNING') }}</h3>
5959
{% for provider in PROVIDERS %}
6060
{% if provider.is_available %}
6161
<fieldset id="{{ storage.get_name }}_{{ provider.get_name }}_settings">
62-
<legend>{{ lang('STORAGE_' ~ storage.get_name | upper ~ '_TITLE') }} - {{ lang('STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_NAME') }}</legend>
62+
<legend>{{ lang('STORAGE_' ~ storage.get_name | upper ~ '_TITLE') }} - {{ provider.get_title }}</legend>
6363
{% for name, options in provider.get_options %}
6464
<dl>
6565
<dt>
66-
{% set title = 'STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_OPTION_' ~ name | upper %}
67-
{% set description = 'STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_OPTION_' ~ name | upper ~ '_EXPLAIN' %}
68-
<label>{{ lang(title) ~ lang('COLON') }}</label>
69-
{% if lang_defined(description) %}
70-
<br /><span>{{ lang(description) }}</span>
66+
<label>{{ options.title ~ lang('COLON') }}</label>
67+
{% if options.description %}
68+
<br /><span>{{ options.description }}</span>
7169
{% endif %}
7270
</dt>
7371
<dd>
7472
{% set input_name = storage.get_name ~ '[' ~ name ~ ']' %}
7573
{% set input_value = attribute(config, 'storage\\' ~ storage.get_name ~ '\\config\\' ~ name) %}
74+
{% set form_macro = options.form_macro %}
7675

77-
{% if options.tag == 'input' %}
78-
{{ FormsInput(options | merge({"name": input_name, "value": input_value})) }}
79-
{% elseif options.tag == 'textarea' %}
80-
{{ FormsTextarea(options | merge({"name": input_name, "content": input_value})) }}
81-
{% elseif options.tag == 'radio' %}
76+
{% if form_macro.tag == 'input' %}
77+
{{ FormsInput(form_macro | merge({"name": input_name, "value": input_value})) }}
78+
{% elseif form_macro.tag == 'textarea' %}
79+
{{ FormsTextarea(form_macro | merge({"name": input_name, "content": input_value})) }}
80+
{% elseif form_macro.tag == 'radio' %}
8281
{% set buttons = [] %}
8382

84-
{% for button in options.buttons %}
83+
{% for button in form_macro.buttons %}
8584
{% set new_button = button | merge({"name": input_name, "checked": button.value == input_value}) %}
8685
{% set buttons = buttons | merge([new_button]) %}
8786
{% endfor %}
8887

89-
{{ FormsRadioButtons(options | merge({"buttons": buttons})) }}
90-
{% elseif options.tag == 'select' %}
88+
{{ FormsRadioButtons(form_macro | merge({"buttons": buttons})) }}
89+
{% elseif form_macro.tag == 'select' %}
9190
{% set select_options = [] %}
9291

93-
{% for option in options.options %}
92+
{% for option in form_macro.options %}
9493
{% set new_option = option | merge({"selected": option.value == input_value}) %}
9594
{% set select_options = select_options | merge([new_option]) %}
9695
{% endfor %}
9796

98-
{{ FormsSelect(options | merge({"name": input_name, "options": select_options})) }}
97+
{{ FormsSelect(form_macro | merge({"name": input_name, "options": select_options})) }}
9998
{% endif %}
10099
</dd>
101100
</dl>
@@ -109,9 +108,9 @@ <h3>{{ lang('WARNING') }}</h3>
109108
<dl>
110109
<dt><label for="update_type">{{ lang('STORAGE_UPDATE_TYPE') ~ lang('COLON') }}</label></dt>
111110
<dd>
112-
<label><input id="update_type" class="radio" name="update_type" value="{{ STORAGE_UPDATE_TYPE_CONFIG }}" checked="checked" type="radio"> {{ lang('STORAGE_UPDATE_TYPE_CONFIG') }}</label>
111+
<label><input class="radio" name="update_type" value="{{ STORAGE_UPDATE_TYPE_CONFIG }}" type="radio"> {{ lang('STORAGE_UPDATE_TYPE_CONFIG') }}</label>
113112
<label><input class="radio" name="update_type" value="{{ STORAGE_UPDATE_TYPE_COPY }}" type="radio"> {{ lang('STORAGE_UPDATE_TYPE_COPY') }}</label>
114-
<label><input class="radio" name="update_type" value="{{ STORAGE_UPDATE_TYPE_MOVE }}" type="radio"> {{ lang('STORAGE_UPDATE_TYPE_MOVE') }}</label>
113+
<label><input class="radio" name="update_type" value="{{ STORAGE_UPDATE_TYPE_MOVE }}" type="radio" checked="checked" id="update_type"> {{ lang('STORAGE_UPDATE_TYPE_MOVE') }}</label>
115114
</dd>
116115
</dl>
117116
</fieldset>

phpBB/adm/style/admin.js

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ function parse_document(container)
123123
}
124124

125125
if ((text.length && text !== '-') || cell.children().length) {
126-
if (headers[column] != '') {
127-
cell.prepend('<dfn style="display: none;">' + headers[column] + '</dfn>');
126+
if (headers[column].length) {
127+
cell.prepend($("<dfn>").css('display', 'none').text(headers[column]));
128128
}
129129
}
130130
else {
@@ -145,7 +145,7 @@ function parse_document(container)
145145
*/
146146
container.find('table.responsive > tbody').each(function() {
147147
var items = $(this).children('tr');
148-
if (items.length == 0)
148+
if (!items.length)
149149
{
150150
$(this).parent('table:first').addClass('responsive-hide');
151151
}
@@ -159,7 +159,21 @@ function parse_document(container)
159159
if ($this.html() == '&nbsp;') {
160160
$this.addClass('responsive-hide');
161161
}
162+
});
162163

164+
/**
165+
* Dynamically control a text field's maxlength (allows emoji to be counted as 1 character)
166+
*/
167+
container.find('#sitename_short').each(function() {
168+
const $this = this;
169+
const maxLength = $this.maxLength;
170+
$this.maxLength = maxLength * 2;
171+
$this.addEventListener('input', () => {
172+
const inputChars = Array.from($this.value);
173+
if (inputChars.length > maxLength) {
174+
$this.value = inputChars.slice(0, maxLength).join('');
175+
}
176+
});
163177
});
164178

165179
/**
@@ -186,7 +200,7 @@ function parse_document(container)
186200
var width = $body.width(),
187201
height = $this.height();
188202

189-
if (arguments.length == 0 && (!responsive || width <= lastWidth) && height <= maxHeight) {
203+
if (!arguments.length && (!responsive || width <= lastWidth) && height <= maxHeight) {
190204
return;
191205
}
192206

@@ -261,5 +275,34 @@ function parse_document(container)
261275
$('.actions a:has(i.acp-icon)').mouseover(function () {
262276
$(this).css("text-decoration", "none");
263277
});
278+
279+
// Live update BBCode font icon preview
280+
const updateIconClass = (element, newClass) => {
281+
// Ignore invalid class names
282+
const faIconRegex = /^(?!-)(?!.*--)[a-z0-9-]+(?<!-)$/;
283+
if (!faIconRegex.test(newClass)) {
284+
return;
285+
}
286+
287+
element.classList.forEach(className => {
288+
if (className.startsWith('fa-') && className !== 'fa-fw') {
289+
element.classList.remove(className);
290+
}
291+
});
292+
293+
element.classList.add(`fa-${newClass}`);
294+
};
295+
296+
const pageIconFont = document.getElementById('bbcode_font_icon');
297+
298+
if (pageIconFont) {
299+
pageIconFont.addEventListener('keyup', function () {
300+
updateIconClass(this.nextElementSibling, this.value);
301+
});
302+
303+
pageIconFont.addEventListener('blur', function () {
304+
updateIconClass(this.nextElementSibling, this.value);
305+
});
306+
}
264307
});
265308
})(jQuery);

phpBB/adm/style/ajax.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,20 @@ function submitPermissions() {
284284
if ($alertBoxLink) {
285285
// Remove forum_id[] from URL
286286
$alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/g, ''));
287-
var previousPageForm = '<form action="' + $alertBoxLink.attr('href') + '" method="post">';
287+
const $previousPageForm = $('<form>').attr({
288+
action: $alertBoxLink.attr('href'),
289+
method: 'post'
290+
});
291+
288292
$.each(forumIds, function (key, value) {
289-
previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />';
293+
$previousPageForm.append($('<input>').attr({
294+
type: 'text',
295+
name: 'forum_id[]',
296+
value: value
297+
}));
290298
});
291-
previousPageForm += '</form>';
292299

293300
$alertBoxLink.on('click', function (e) {
294-
var $previousPageForm = $(previousPageForm);
295301
$('body').append($previousPageForm);
296302
e.preventDefault();
297303
$previousPageForm.submit();
@@ -306,12 +312,19 @@ function submitPermissions() {
306312
setTimeout(function () {
307313
// Create forum to submit using POST. This will prevent
308314
// exceeding the maximum length of URLs
309-
var form = '<form action="' + res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, '') + '" method="post">';
315+
const $form = $('<form>').attr({
316+
action: res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, ''),
317+
method: 'post'
318+
});
319+
310320
$.each(forumIds, function (key, value) {
311-
form += '<input type="text" name="forum_id[]" value="' + value + '" />';
321+
$form.append($('<input>').attr({
322+
type: 'text',
323+
name: 'forum_id[]',
324+
value: value
325+
}));
312326
});
313-
form += '</form>';
314-
$form = $(form);
327+
315328
$('body').append($form);
316329

317330
// Hide the alert even if we refresh the page, in case the user

phpBB/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
},
2828
"require": {
2929
"php": "^8.1",
30-
"ext-json": "*",
3130
"ext-pdo": "*",
31+
"ext-zip": "*",
3232
"ext-zlib": "*",
33+
"ext-sodium": "*",
3334
"bantu/ini-get-wrapper": "~1.0",
3435
"carlos-mg89/oauth": "^0.8.15",
3536
"chita/topological_sort": "^3.0",
@@ -52,6 +53,7 @@
5253
"symfony/http-foundation": "^6.3",
5354
"symfony/http-kernel": "^6.3",
5455
"symfony/polyfill-mbstring": "^1.23",
56+
"symfony/mailer": "^6.3",
5557
"symfony/mime": "^6.3",
5658
"symfony/process": "^6.3",
5759
"symfony/proxy-manager-bridge": "^6.3",

0 commit comments

Comments
 (0)