Skip to content

Commit 851359e

Browse files
authored
[5.3] Upmerge changes from 5.2-dev 2025-01-10
2 parents a9a401a + 21499b3 commit 851359e

File tree

87 files changed

+377
-318
lines changed

Some content is hidden

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

87 files changed

+377
-318
lines changed

administrator/components/com_newsfeeds/tmpl/newsfeed/modalreturn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* @package Joomla.Administrator
5-
* @subpackage com_content
5+
* @subpackage com_newsfeeds
66
*
77
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
88
* @license GNU General Public License version 2 or later; see LICENSE.txt

administrator/components/com_scheduler/src/Table/TaskTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ protected function _getAssetName(): string
172172
*
173173
* @return string
174174
*
175-
* @since 5.3.0
175+
* @since 5.2.3
176176
*/
177177
protected function _getAssetTitle(): string
178178
{
@@ -191,7 +191,7 @@ protected function _getAssetTitle(): string
191191
*
192192
* @return integer
193193
*
194-
* @since 5.3.0
194+
* @since 5.2.3
195195
*/
196196
protected function _getAssetParentId(?Table $table = null, $id = null): int
197197
{

administrator/language/en-GB/plg_system_httpheaders.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY="<a href='https://developer.mozilla
1111
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_CLIENT="Client"
1212
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_FRAME_ANCESTORS_SELF_ENABLED="frame-ancestors 'self'" ; Do not translate
1313
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_FRAME_ANCESTORS_SELF_ENABLED_DESC="Enable the CSP clickjacking protection frame-ancestors and only allow the origin 'self'. Please use the form below to allow origins other than 'self'."
14-
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_NONCE_ENABLED="<a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src' target='_blank' rel='noopener noreferrer'>Nonce</a>" ; Please only change the URL
14+
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_NONCE_ENABLED="<a href='https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce' target='_blank' rel='noopener noreferrer'>Nonce</a>" ; Please only change the URL
1515
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_NONCE_ENABLED_DESC="Enable the whitelist for specific inline scripts using a cryptographic nonce (number used once) for all scripts and styles using the Joomla API. Specifying a nonce makes a modern browser ignore 'unsafe-inline' which should still be set for older browsers without nonce support."
1616
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_REPORT_ONLY_DESC="Use the header 'Content-Security-Policy-Report-Only' instead of 'Content-Security-Policy'." ; Do not translate 'Content-Security-Policy' & 'Content-Security-Policy-Report-Only'
1717
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_REPORT_ONLY="Report-Only" ; Do not translate
1818
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_STRICT_DYNAMIC_ENABLED="strict-dynamic" ; Do not translate
1919
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_STRICT_DYNAMIC_ENABLED_DESC="The strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. At the same time, any allowed or source expressions such as 'self' or 'unsafe-inline' will be ignored." ; Do not translate 'strict-dynamic', 'self' and 'unsafe-inline'
2020
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_SCRIPT_HASHES_ENABLED="<a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src' target='_blank' rel='noopener noreferrer'>Script hashes</a>" ; Please only change the URL
2121
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_SCRIPT_HASHES_ENABLED_DESC="Enable the optional hash based whitelist inline scripts using a cryptographic hash for all scripts using the Joomla API. Specifying hashes makes a modern browser ignore 'unsafe-inline' which should still be set for older browsers without hash support."
22-
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_STYLE_HASHES_ENABLED="<a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src' target='_blank' rel='noopener noreferrer'>Style hashes</a>" ; Please only change the URL
22+
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_STYLE_HASHES_ENABLED="<a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src' target='_blank' rel='noopener noreferrer'>Style hashes</a>" ; Please only change the URL
2323
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_STYLE_HASHES_ENABLED_DESC="Enable the optional hash based whitelist inline styles using a cryptographic hash for all styles using the Joomla API. Specifying hashes makes a modern browser ignore 'unsafe-inline' which should still be set for older browsers without hash support."
2424
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_VALUES="Add Directive"
2525
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_VALUES_DIRECTIVE="Policy Directive"
2626
PLG_SYSTEM_HTTPHEADERS_CONTENTSECURITYPOLICY_VALUES_VALUE="Value"
2727
PLG_SYSTEM_HTTPHEADERS_COOP="Cross-Origin-Opener-Policy" ; Do not translate
2828
PLG_SYSTEM_HTTPHEADERS_HEADER_CLIENT="Client"
2929
PLG_SYSTEM_HTTPHEADERS_HEADER_CLIENT_BOTH="Both"
30-
PLG_SYSTEM_HTTPHEADERS_HSTS="<a href='https://hstspreload.org' target='_blank' rel='noopener noreferrer'>HTTP Strict Transport Security (HSTS)</a>" ; Do not translate
30+
PLG_SYSTEM_HTTPHEADERS_HSTS="<a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security' target='_blank' rel='noopener noreferrer'>HTTP Strict Transport Security (HSTS)</a>" ; Please only change the URL
3131
PLG_SYSTEM_HTTPHEADERS_HSTS_MAXAGE="max-age" ; Do not translate
3232
PLG_SYSTEM_HTTPHEADERS_HSTS_MAXAGE_DESC="This option sets the time for 'max-age', it is specified in seconds. The default value is 31536000, which corresponds to one year" ; Please do not translate 'max-age'
33-
PLG_SYSTEM_HTTPHEADERS_HSTS_PRELOAD="Preload" ; Do not translate
33+
PLG_SYSTEM_HTTPHEADERS_HSTS_PRELOAD="<a href='https://hstspreload.org' target='_blank' rel='noopener noreferrer'>Preload</a>" ; Do not translate
3434
PLG_SYSTEM_HTTPHEADERS_HSTS_PRELOAD_DESC="This option activates the opt-in for inclusion in so-called browser preload lists."
3535
PLG_SYSTEM_HTTPHEADERS_HSTS_PRELOAD_NOTE="Important"
3636
PLG_SYSTEM_HTTPHEADERS_HSTS_PRELOAD_NOTE_DESC="HSTS means that your domain can no longer be called without HTTPS. Once added to the preload list, this is not easy to undo. Domains can be removed, but it takes months for users to make a change with a browser update.<br><strong>This option is very important to prevent 'man-in-the-middle attacks', so it should be activated in any case, but only if you are sure that HTTPS is supported for domain and all subdomains in the long run! The value for 'max-age' must be set to 63072000 (2 years) for recording.</strong>" ; Please do not translate 'max-age'

administrator/modules/mod_quickicon/tmpl/default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
$html = HTMLHelper::_('icons.buttons', $buttons);
2323
?>
2424
<?php if (!empty($html)) : ?>
25-
<nav class="quick-icons px-3 pb-3" aria-label="<?php echo Text::_('MOD_QUICKICON_NAV_LABEL') . ' ' . $module->title; ?>">
25+
<nav class="quick-icons px-3 pb-3" aria-label="<?php echo Text::_('MOD_QUICKICON_NAV_LABEL') . ' ' . htmlspecialchars($module->title, ENT_QUOTES, 'UTF-8'); ?>">
2626
<ul class="nav flex-wrap">
2727
<?php echo $html; ?>
2828
</ul>

build/build-modules-js/init/common/resolve-package.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports.resolvePackageFile = (relativePath) => {
2727
* @returns {[]}
2828
*/
2929
module.exports.getPackagesUnderScope = (scope) => {
30-
const cmModules = [];
30+
const cmModules = new Set();
3131

3232
// Get the scope roots
3333
const roots = [];
@@ -41,9 +41,9 @@ module.exports.getPackagesUnderScope = (scope) => {
4141
// List of modules
4242
roots.forEach((rootPath) => {
4343
readdirSync(rootPath).forEach((subModule) => {
44-
cmModules.push(`${scope}/${subModule}`);
44+
cmModules.add(`${scope}/${subModule}`);
4545
});
4646
});
4747

48-
return cmModules;
48+
return [...cmModules];
4949
};

components/com_privacy/src/Controller/DisplayController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
namespace Joomla\Component\Privacy\Site\Controller;
1212

1313
use Joomla\CMS\MVC\Controller\BaseController;
14-
use Joomla\CMS\Router\Route;
1514

1615
// phpcs:disable PSR1.Files.SideEffects
1716
\defined('_JEXEC') or die;
@@ -39,15 +38,6 @@ public function display($cachable = false, $urlparams = [])
3938
{
4039
$view = $this->input->get('view', $this->default_view);
4140

42-
// Submitting information requests and confirmation through the frontend is restricted to authenticated users at this time
43-
if (\in_array($view, ['confirm', 'request']) && $this->app->getIdentity()->guest) {
44-
$this->setRedirect(
45-
Route::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=' . $view), false)
46-
);
47-
48-
return $this;
49-
}
50-
5141
// Set a Referrer-Policy header for views which require it
5242
if (\in_array($view, ['confirm', 'remind'])) {
5343
$this->app->setHeader('Referrer-Policy', 'no-referrer', true);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/**
4+
* @package Joomla.Site
5+
* @subpackage com_privacy
6+
*
7+
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
8+
* @license GNU General Public License version 2 or later; see LICENSE.txt
9+
*/
10+
11+
namespace Joomla\Component\Privacy\Site\Dispatcher;
12+
13+
use Joomla\CMS\Dispatcher\ComponentDispatcher;
14+
use Joomla\CMS\Router\Route;
15+
16+
// phpcs:disable PSR1.Files.SideEffects
17+
\defined('_JEXEC') or die;
18+
// phpcs:enable PSR1.Files.SideEffects
19+
20+
/**
21+
* ComponentDispatcher class for com_privacy
22+
*
23+
* @since 5.2.3
24+
*/
25+
class Dispatcher extends ComponentDispatcher
26+
{
27+
/**
28+
* Method to check component access permission
29+
*
30+
* @since 5.2.3
31+
*
32+
* @return void
33+
*/
34+
protected function checkAccess()
35+
{
36+
parent::checkAccess();
37+
38+
$view = $this->input->get('view');
39+
40+
// Submitting information requests and confirmation through the frontend is restricted to authenticated users at this time
41+
if (\in_array($view, ['confirm', 'request']) && $this->app->getIdentity()->guest) {
42+
$this->app->redirect(
43+
Route::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=' . $view), false)
44+
);
45+
}
46+
}
47+
}

components/com_users/src/Controller/DisplayController.php

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
namespace Joomla\Component\Users\Site\Controller;
1212

13-
use Joomla\CMS\Component\ComponentHelper;
1413
use Joomla\CMS\MVC\Controller\BaseController;
15-
use Joomla\CMS\Router\Route;
1614

1715
// phpcs:disable PSR1.Files.SideEffects
1816
\defined('_JEXEC') or die;
@@ -50,61 +48,11 @@ public function display($cachable = false, $urlparams = false)
5048
if ($view = $this->getView($vName, $vFormat)) {
5149
// Do any specific processing by view.
5250
switch ($vName) {
53-
case 'registration':
54-
// If the user is already logged in, redirect to the profile page.
55-
$user = $this->app->getIdentity();
56-
57-
if ($user->guest != 1) {
58-
// Redirect to profile page.
59-
$this->setRedirect(Route::_('index.php?option=com_users&view=profile', false));
60-
61-
return;
62-
}
63-
64-
// Check if user registration is enabled
65-
if (ComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) {
66-
// Registration is disabled - Redirect to login page.
67-
$this->setRedirect(Route::_('index.php?option=com_users&view=login', false));
68-
69-
return;
70-
}
71-
72-
// The user is a guest, load the registration model and show the registration page.
73-
$model = $this->getModel('Registration');
74-
break;
75-
76-
case 'profile':
77-
// Handle view specific models.
78-
// If the user is a guest, redirect to the login page.
79-
$user = $this->app->getIdentity();
80-
81-
if ($user->guest == 1) {
82-
// Redirect to login page.
83-
$this->setRedirect(Route::_('index.php?option=com_users&view=login', false));
84-
85-
return;
86-
}
87-
88-
$model = $this->getModel($vName);
89-
break;
90-
91-
case 'login':
92-
// Handle the default views.
93-
$model = $this->getModel($vName);
94-
break;
95-
9651
case 'remind':
9752
case 'reset':
98-
// If the user is already logged in, redirect to the profile page.
99-
$user = $this->app->getIdentity();
100-
101-
if ($user->guest != 1) {
102-
// Redirect to profile page.
103-
$this->setRedirect(Route::_('index.php?option=com_users&view=profile', false));
104-
105-
return;
106-
}
107-
53+
case 'registration':
54+
case 'login':
55+
case 'profile':
10856
$model = $this->getModel($vName);
10957
break;
11058

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
/**
4+
* @package Joomla.Site
5+
* @subpackage com_privacy
6+
*
7+
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
8+
* @license GNU General Public License version 2 or later; see LICENSE.txt
9+
*/
10+
11+
namespace Joomla\Component\Users\Site\Dispatcher;
12+
13+
use Joomla\CMS\Component\ComponentHelper;
14+
use Joomla\CMS\Dispatcher\ComponentDispatcher;
15+
use Joomla\CMS\Router\Route;
16+
17+
// phpcs:disable PSR1.Files.SideEffects
18+
\defined('_JEXEC') or die;
19+
// phpcs:enable PSR1.Files.SideEffects
20+
21+
/**
22+
* ComponentDispatcher class for com_privacy
23+
*
24+
* @since 5.2.3
25+
*/
26+
class Dispatcher extends ComponentDispatcher
27+
{
28+
/**
29+
* Method to check component access permission
30+
*
31+
* @since 5.2.3
32+
*
33+
* @return void
34+
*/
35+
protected function checkAccess()
36+
{
37+
parent::checkAccess();
38+
39+
$view = $this->input->get('view');
40+
$user = $this->app->getIdentity();
41+
42+
// Do any specific processing by view.
43+
switch ($view) {
44+
case 'registration':
45+
// If the user is already logged in, redirect to the profile page.
46+
if ($user->get('guest') != 1) {
47+
// Redirect to profile page.
48+
$this->app->redirect(Route::_('index.php?option=com_users&view=profile', false));
49+
}
50+
51+
// Check if user registration is enabled
52+
if (ComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) {
53+
// Registration is disabled - Redirect to login page.
54+
$this->app->redirect(Route::_('index.php?option=com_users&view=login', false));
55+
}
56+
break;
57+
58+
// Handle view specific models.
59+
case 'profile':
60+
if ($user->get('guest') == 1) {
61+
// Redirect to login page.
62+
$this->app->redirect(Route::_('index.php?option=com_users&view=login', false));
63+
}
64+
break;
65+
66+
case 'remind':
67+
case 'reset':
68+
if ($user->get('guest') != 1) {
69+
// Redirect to profile page.
70+
$this->app->redirect(Route::_('index.php?option=com_users&view=profile', false));
71+
}
72+
}
73+
}
74+
}

includes/incompatible.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)