Skip to content

Commit

Permalink
Merge branch '4.4-dev' into 4.4-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
conseilgouz committed Mar 4, 2024
2 parents 6c0a5fb + 0a912a8 commit 3791be1
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 45 deletions.
Expand Up @@ -37,7 +37,7 @@ class ExecutionRulesRule extends FormRule
* @var string CUSTOM_RULE_GROUP The field group containing custom execution rules
* @since 4.1.0
*/
private const CUSTOM_RULE_GROUP = "execution_rules.custom";
private const CUSTOM_RULE_GROUP = "execution_rules.cron-expression";

/**
* @param \SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form
Expand All @@ -59,7 +59,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, Registry
$fieldName = (string) $element['name'];
$ruleType = $input->get(self::RULE_TYPE_FIELD);

if ($ruleType === $fieldName || ($ruleType === 'custom' && $group === self::CUSTOM_RULE_GROUP)) {
if ($ruleType === $fieldName || ($ruleType === 'cron-expression' && $group === self::CUSTOM_RULE_GROUP)) {
return $this->validateField($element, $value, $group, $form);
}

Expand All @@ -82,7 +82,9 @@ private function validateField(\SimpleXMLElement $element, $value, ?string $grou

// If element is of cron type, we test against options and return
if ($elementType === 'cron') {
return (new OptionsRule())->test($element, $value, $group, null, $form);
$clonedElement = clone $element;
$clonedElement->addAttribute('required', 'true');
return (new OptionsRule())->test($clonedElement, $value, $group, null, $form);
}

// Test for a positive integer value and return
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_system_jooa11y.ini
Expand Up @@ -11,7 +11,7 @@ PLG_SYSTEM_JOOA11Y_FIELD_CONTAINER_IGNORE_DESC="Ignore specific regions within t
PLG_SYSTEM_JOOA11Y_FIELD_READABILITY_ROOT="Readability Container"
PLG_SYSTEM_JOOA11Y_FIELD_READABILITY_ROOT_DESC="Landmark on the page that will be checked for readability. The default setting is the landmark <strong>main</strong>. Alternatives to landmarks are classes, elements or ARIA roles (eg #example, .example, [role=example])."
PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS="Show Always"
PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS_DESC="Load the accessiblity checker on all pages. This is useful when developing the website but should not be left on when the website is live."
PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS_DESC="Load the accessibility checker on all pages. This is useful when developing the website but should not be left on when the website is live."
PLG_SYSTEM_JOOA11Y_XML_DESCRIPTION="The Joomla Accessibility Checker visually highlights common accessibility and usability issues. Geared towards content authors, the plugin identifies errors or warnings and provides guidance on how to fix them."

;Global text
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_system_privacyconsent.ini
Expand Up @@ -4,7 +4,7 @@
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_PRIVACYCONSENT="System - Privacy Consent"
PLG_SYSTEM_PRIVACYCONSENT_BODY="<p>The user consented to storing their user information using the IP address <strong>%s</strong></p><p>The user agent string of the user's browser was:<br>%s</p><p>This information was automatically recorded when the user submitted their details on the website and checked the confirm box</p>"
PLG_SYSTEM_PRIVACYCONSENT_BODY="<p>The user consented to storing their user information using the IP address <strong>%s</strong></p><p>The user agent string of the user's browser was:<br>%s</p><p>This information was automatically recorded when the user submitted their details on the website and checked the confirm box.</p>"
PLG_SYSTEM_PRIVACYCONSENT_CACHETIMEOUT_DESC="How often the check is performed."
PLG_SYSTEM_PRIVACYCONSENT_CACHETIMEOUT_LABEL="Periodic check (days)"
PLG_SYSTEM_PRIVACYCONSENT_CONSENT="User <a href='{accountlink}'>{username}</a> consented to the privacy policy."
Expand Down
3 changes: 2 additions & 1 deletion build/media_source/legacy/joomla.asset.json
Expand Up @@ -17,7 +17,8 @@
"name": "joomla.treeselectmenu",
"type": "script",
"dependencies": [
"jquery"
"jquery",
"bootstrap.dropdown"
],
"uri": "legacy/treeselectmenu.min.js",
"attributes": {
Expand Down
28 changes: 24 additions & 4 deletions build/media_source/legacy/js/treeselectmenu.es5.js
Expand Up @@ -77,13 +77,23 @@ jQuery(function($)
// Checks all checkboxes the tree
$('#treeCheckAll').click(function()
{
$('.treeselect input').attr('checked', 'checked');
$('.treeselect input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', true);
}
});
});

// Unchecks all checkboxes the tree
$('#treeUncheckAll').click(function()
{
$('.treeselect input').attr('checked', false);
$('.treeselect input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', false);
}
});
});

// Checks all checkboxes the tree
Expand All @@ -102,11 +112,21 @@ jQuery(function($)
// Take care of children check/uncheck all
$('a.checkall').click(function()
{
$(this).parents().eq(4).find('ul.treeselect-sub input').attr('checked', 'checked');
$(this).parents().eq(4).find('input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', true);
}
});
});
$('a.uncheckall').click(function()
{
$(this).parents().eq(4).find('ul.treeselect-sub input').attr('checked', false);
$(this).parents().eq(4).find('input').each(function() {
var self = $(this);
if (!self.prop('disabled')) {
self.prop('checked', false);
}
});
});

// Take care of children toggle all
Expand Down
38 changes: 24 additions & 14 deletions components/com_config/src/Controller/ModulesController.php
Expand Up @@ -59,8 +59,8 @@ public function __construct($config = [], MVCFactoryInterface $factory = null, $
*/
public function cancel()
{
// Redirect back to home(base) page
$this->setRedirect(Uri::base());
// Redirect back to previous page
$this->setRedirect($this->getReturnUrl());
}

/**
Expand Down Expand Up @@ -150,19 +150,29 @@ public function save()

case 'save':
default:
if (!empty($returnUri)) {
$redirect = base64_decode(urldecode($returnUri));

// Don't redirect to an external URL.
if (!Uri::isInternal($redirect)) {
$redirect = Uri::base();
}
} else {
$redirect = Uri::base();
}

$this->setRedirect($redirect);
$this->setRedirect($this->getReturnUrl());
break;
}
}

/**
* Method to get redirect URL after saving or cancel editing a module from frontend
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
private function getReturnUrl(): string
{
if ($return = $this->input->post->get('return', '', 'BASE64')) {
$return = base64_decode(urldecode($return));

// Only redirect to if it is an internal URL
if (Uri::isInternal($return)) {
return $return;
}
}

return Uri::base();
}
}
8 changes: 4 additions & 4 deletions libraries/src/Feed/Parser/AtomParser.php
Expand Up @@ -223,7 +223,7 @@ protected function processFeedEntry(FeedEntry $entry, \SimpleXMLElement $el)
if (filter_var($entry->uri, FILTER_VALIDATE_URL) === false && !\is_null($el->link) && $el->link) {
$link = $el->link;

if (\is_array($link)) {
if ($link->count()) {
$link = $this->bestLinkForUri($link);
}

Expand All @@ -238,13 +238,13 @@ protected function processFeedEntry(FeedEntry $entry, \SimpleXMLElement $el)
/**
* If there is more than one <link> in the feed entry, find the most appropriate one and return it.
*
* @param array $links Array of <link> elements from the feed entry.
* @param \SimpleXMLElement $links XML node with links from the feed entry.
*
* @return \SimpleXMLElement
*/
private function bestLinkForUri(array $links)
private function bestLinkForUri(\SimpleXMLElement $links)
{
$linkPrefs = ['', 'self', 'alternate'];
$linkPrefs = ['alternate', 'self', ''];

foreach ($linkPrefs as $pref) {
foreach ($links as $link) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Mail/MailerFactory.php
Expand Up @@ -54,7 +54,7 @@ public function __construct(Registry $defaultConfiguration)
*/
public function createMailer(?Registry $settings = null): MailerInterface
{
$configuration = clone $this->defaultConfiguration;
$configuration = new Registry($this->defaultConfiguration);

if ($settings) {
$configuration->merge($settings);
Expand Down
Expand Up @@ -60,7 +60,7 @@ public function getChildrenCategories(Registry $moduleParams, SiteApplication $a
}

// Get all the children categories of this node
$childrenCategories = $parentCategory->getChildren(true);
$childrenCategories = $parentCategory->getChildren();

$count = $moduleParams->get('count', 0);

Expand Down
22 changes: 9 additions & 13 deletions plugins/system/cache/src/Extension/Cache.php
Expand Up @@ -321,6 +321,7 @@ private function isExcluded(): bool
// Convert the exclusions into a normalised array
$exclusions = str_replace(["\r\n", "\r"], "\n", $exclusions);
$exclusions = explode("\n", $exclusions);
$exclusions = array_map('trim', $exclusions);
$filterExpression = function ($x) {
return $x !== '';
};
Expand All @@ -331,19 +332,14 @@ private function isExcluded(): bool
. Uri::getInstance()->buildQuery($this->router->getVars());
$externalUrl = Uri::getInstance()->toString();

$reduceCallback
= function (bool $carry, string $exclusion) use ($internalUrl, $externalUrl) {
// Test both external and internal URIs
return $carry && preg_match(
'#' . $exclusion . '#i',
$externalUrl . ' ' . $internalUrl,
$match
);
};
$excluded = array_reduce($exclusions, $reduceCallback, false);

if ($excluded) {
return true;
// Loop through each pattern.
if ($exclusions) {
foreach ($exclusions as $exclusion) {
// Test both external and internal URI
if (preg_match('#' . $exclusion . '#i', $externalUrl . ' ' . $internalUrl, $match)) {
return true;
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/system/highlight/src/Extension/Highlight.php
Expand Up @@ -121,7 +121,7 @@ public function onFinderResult($item, $query)
&& empty($item->mime)
&& $params->get('highlight_terms', 1)
) {
$item->route .= '&highlight=' . base64_encode(json_encode($query->highlight));
$item->route .= '&highlight=' . base64_encode(json_encode(array_slice($query->highlight, 0, 10)));
}
}
}
2 changes: 1 addition & 1 deletion plugins/system/sef/src/Extension/Sef.php
Expand Up @@ -98,7 +98,7 @@ public function onAfterRender()
foreach ($matches[1] as $urlQueryString) {
$buffer = str_replace(
'href="' . $prefix . 'index.php?' . $urlQueryString . '"',
'href="' . trim($prefix, '/') . Route::_('index.php?' . $urlQueryString) . '"',
'href="' . $prefix . Route::_('index.php?' . $urlQueryString) . '"',
$buffer
);
}
Expand Down

0 comments on commit 3791be1

Please sign in to comment.