Skip to content

Commit 226391c

Browse files
authored
Merge pull request #39548 from obuisard/upmerge-2023-01-02
2 parents 1615ad2 + 53cd9eb commit 226391c

File tree

55 files changed

+1893
-1529
lines changed

Some content is hidden

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

55 files changed

+1893
-1529
lines changed

administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
200200

201201
foreach ($messageData as $key => $value) {
202202
// Escape any markup in the values to prevent XSS attacks
203-
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
203+
$value = $value !== null ? htmlspecialchars($value, ENT_QUOTES, 'UTF-8') : '';
204204

205205
// Convert relative url to absolute url so that it is clickable in action logs notification email
206206
if ($generateLinks && StringHelper::strpos($value, 'index.php?') === 0) {

administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-12-20.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ INSERT IGNORE INTO `#__mail_templates` (`template_id`, `language`, `subject`, `b
1212
('com_users.registration.user.admin_activation_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}'),
1313
('com_users.registration.user.self_activation', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW', '', '', '{"tags":["name","sitename","activate","siteurl","username"]}'),
1414
('com_users.registration.user.self_activation_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}'),
15-
('com_users.registration.user.registration_mail', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY_NOPW', '', '', '{"tags":["name","sitename","activate","siteurl","username"]}'),
16-
('com_users.registration.user.registration_mail_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY', '', '', '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}'),
15+
('com_users.registration.user.registration_mail', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY_NOPW', '', '', '{"tags":["name","sitename","siteurl","username"]}'),
16+
('com_users.registration.user.registration_mail_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY', '', '', '{"tags":["name","sitename","siteurl","username","password_clear"]}'),
1717
('com_users.registration.admin.new_notification', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY', '', '', '{"tags":["name","sitename","siteurl","username"]}'),
1818
('com_users.registration.user.admin_activated', '', 'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT', 'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","siteurl","username"]}'),
1919
('com_users.registration.admin.verification_request', '', 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT', 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","email","username","activate"]}'),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
UPDATE `#__mail_templates`
2+
SET `params` = '{"tags":["name","sitename","siteurl","username"]}'
3+
WHERE `template_id` = 'com_users.registration.user.registration_mail' AND `params` = '{"tags":["name","sitename","activate","siteurl","username"]}';
4+
5+
UPDATE `#__mail_templates`
6+
SET `params` = '{"tags":["name","sitename","siteurl","username","password_clear"]}'
7+
WHERE `template_id` = 'com_users.registration.user.registration_mail_w_pw' AND `params` = '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}';

administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-12-20.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", "
1212
('com_users.registration.user.admin_activation_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}'),
1313
('com_users.registration.user.self_activation', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW', '', '', '{"tags":["name","sitename","activate","siteurl","username"]}'),
1414
('com_users.registration.user.self_activation_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}'),
15-
('com_users.registration.user.registration_mail', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY_NOPW', '', '', '{"tags":["name","sitename","activate","siteurl","username"]}'),
16-
('com_users.registration.user.registration_mail_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY', '', '', '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}'),
15+
('com_users.registration.user.registration_mail', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY_NOPW', '', '', '{"tags":["name","sitename","siteurl","username"]}'),
16+
('com_users.registration.user.registration_mail_w_pw', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_BODY', '', '', '{"tags":["name","sitename","siteurl","username","password_clear"]}'),
1717
('com_users.registration.admin.new_notification', '', 'COM_USERS_EMAIL_ACCOUNT_DETAILS', 'COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY', '', '', '{"tags":["name","sitename","siteurl","username"]}'),
1818
('com_users.registration.user.admin_activated', '', 'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT', 'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","siteurl","username"]}'),
1919
('com_users.registration.admin.verification_request', '', 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT', 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","email","username","activate"]}'),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
UPDATE "#__mail_templates"
2+
SET "params" = '{"tags":["name","sitename","siteurl","username"]}'
3+
WHERE "template_id" = 'com_users.registration.user.registration_mail' AND "params" = '{"tags":["name","sitename","activate","siteurl","username"]}';
4+
5+
UPDATE "#__mail_templates"
6+
SET "params" = '{"tags":["name","sitename","siteurl","username","password_clear"]}'
7+
WHERE "template_id" = 'com_users.registration.user.registration_mail_w_pw' AND "params" = '{"tags":["name","sitename","activate","siteurl","username","password_clear"]}';

administrator/components/com_categories/src/Helper/CategoryAssociationHelper.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,17 @@ public static function getCategoryAssociations($id = 0, $extension = 'com_conten
5353
if (class_exists($helperClassname) && \is_callable(array($helperClassname, 'getCategoryRoute'))) {
5454
$return[$tag] = $helperClassname::getCategoryRoute($item, $tag, $layout);
5555
} else {
56-
$viewLayout = $layout ? '&layout=' . $layout : '';
56+
$link = 'index.php?option=' . $extension . '&view=category&id=' . $item;
5757

58-
$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item . $viewLayout;
58+
if ($tag && $tag !== '*') {
59+
$link .= '&lang=' . $tag;
60+
}
61+
62+
if ($layout) {
63+
$link .= '&layout=' . $layout;
64+
}
65+
66+
$return[$tag] = $link;
5967
}
6068
}
6169
}

administrator/components/com_categories/src/Model/CategoryModel.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,8 @@ protected function batchFlipordering($value, $pks, $contexts)
825825
* Re-order with max - ordering
826826
*/
827827
foreach ($pks as $id) {
828-
$query->select('MAX(' . $db->quoteName('ordering') . ')')
828+
$query->clear()
829+
->select('MAX(' . $db->quoteName('ordering') . ')')
829830
->from($db->quoteName('#__content'))
830831
->where($db->quoteName('catid') . ' = :catid')
831832
->bind(':catid', $id, ParameterType::INTEGER);
@@ -835,9 +836,8 @@ protected function batchFlipordering($value, $pks, $contexts)
835836
$max = (int) $db->loadResult();
836837
$max++;
837838

838-
$query->clear();
839-
840-
$query->update($db->quoteName('#__content'))
839+
$query->clear()
840+
->update($db->quoteName('#__content'))
841841
->set($db->quoteName('ordering') . ' = :max - ' . $db->quoteName('ordering'))
842842
->where($db->quoteName('catid') . ' = :catid')
843843
->bind(':max', $max, ParameterType::INTEGER)

administrator/components/com_contenthistory/src/View/History/HtmlView.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,21 @@ protected function addToolbar(): Toolbar
9393
$token = Session::getFormToken();
9494

9595
// Clean up input to ensure a clean url.
96-
$aliasArray = explode('.', $this->state->item_id);
97-
$option = $aliasArray[1] == 'category'
98-
? 'com_categories&extension=' . implode('.', array_slice($aliasArray, 0, count($aliasArray) - 2))
99-
: $aliasArray[0];
10096
$filter = InputFilter::getInstance();
97+
$aliasArray = explode('.', $this->state->item_id);
98+
99+
if ($aliasArray[1] === 'category') {
100+
$option = 'com_categories';
101+
$append = '&extension=' . $filter->clean($aliasArray[0], 'cmd');
102+
} else {
103+
$option = $aliasArray[0];
104+
$append = '';
105+
}
106+
101107
$task = $filter->clean($aliasArray[1], 'cmd') . '.loadhistory';
102108

103109
// Build the final urls.
104-
$loadUrl = Route::_('index.php?option=' . $filter->clean($option, 'cmd') . '&task=' . $task . '&' . $token . '=1');
110+
$loadUrl = Route::_('index.php?option=' . $filter->clean($option, 'cmd') . $append . '&task=' . $task . '&' . $token . '=1');
105111
$previewUrl = Route::_('index.php?option=com_contenthistory&view=preview&layout=preview&tmpl=component&' . $token . '=1');
106112
$compareUrl = Route::_('index.php?option=com_contenthistory&view=compare&layout=compare&tmpl=component&' . $token . '=1');
107113

administrator/components/com_fields/src/Model/FieldModel.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,17 @@ private function checkDefaultValue($data)
317317
}
318318

319319
try {
320+
$element = simplexml_import_dom($node->firstChild);
321+
$value = $data['default_value'];
322+
323+
if ($data['type'] === 'checkboxes') {
324+
$value = explode(',', $value);
325+
} elseif ($element['multiple'] && \is_string($value) && \is_array(json_decode($value, true))) {
326+
$value = (array)json_decode($value);
327+
}
328+
320329
// Perform the check
321-
$result = $rule->test(simplexml_import_dom($node->firstChild), $data['default_value']);
330+
$result = $rule->test($element, $value);
322331

323332
// Check if the test succeeded
324333
return $result === true ? : Text::_('COM_FIELDS_FIELD_INVALID_DEFAULT_VALUE');

administrator/components/com_finder/src/Field/ContentmapField.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ protected function getGroups()
8080
}
8181

8282
foreach ($parents[1] as $branch) {
83-
$groups[$branch->text] = $this->prepareLevel($branch->value, $parents);
83+
$text = Text::_(LanguageHelper::branchSingular($branch->text));
84+
$groups[$text] = $this->prepareLevel($branch->value, $parents);
8485
}
8586
}
8687

0 commit comments

Comments
 (0)