JoomlaPolska / jezyk-J4

Język polski dla Joomla 4
GNU General Public License v2.0
3 stars 5 forks source link

[5.1] upmerge 2024-03-04 #470

Closed joomlapl-bot closed 5 months ago

joomlapl-bot commented 6 months ago

PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/42950 Poniżej zmiany w oryginale:

Click to expand the diff! ```diff diff --git a/administrator/components/com_cache/tmpl/cache/default.php b/administrator/components/com_cache/tmpl/cache/default.php index fb058db2b61e5..9abca8e95e8ff 100644 --- a/administrator/components/com_cache/tmpl/cache/default.php +++ b/administrator/components/com_cache/tmpl/cache/default.php @@ -58,10 +58,10 @@ - + - + @@ -76,10 +76,10 @@ escape($item->group); ?> - + count; ?> - + size); ?> diff --git a/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php b/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php index bc833a031201e..9515ec5803e72 100644 --- a/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php +++ b/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php @@ -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 `` tag for the form @@ -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); } @@ -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 diff --git a/administrator/language/en-GB/plg_system_privacyconsent.ini b/administrator/language/en-GB/plg_system_privacyconsent.ini index 427337a1f5a21..fcac49987740b 100644 --- a/administrator/language/en-GB/plg_system_privacyconsent.ini +++ b/administrator/language/en-GB/plg_system_privacyconsent.ini @@ -4,7 +4,9 @@ ; Note : All ini files need to be saved as UTF-8 PLG_SYSTEM_PRIVACYCONSENT="System - Privacy Consent" -PLG_SYSTEM_PRIVACYCONSENT_BODY="

The user consented to storing their user information using the IP address %s

The user agent string of the user's browser was:
%s

This information was automatically recorded when the user submitted their details on the website and checked the confirm box

" +PLG_SYSTEM_PRIVACYCONSENT_BODY="

The user consented to storing their user information using the IP address %s

The user agent string of the user's browser was:
%s

This information was automatically recorded when the user submitted their details on the website and checked the confirm box.

" +PLG_SYSTEM_PRIVACYCONSENT_CACHETIMEOUT_DESC="How often the check is performed." +PLG_SYSTEM_PRIVACYCONSENT_CACHETIMEOUT_LABEL="Periodic check (days)" PLG_SYSTEM_PRIVACYCONSENT_CONSENT="User {username} consented to the privacy policy." PLG_SYSTEM_PRIVACYCONSENT_FIELD_ARTICLE_DESC="Select the article from the list or create a new one." PLG_SYSTEM_PRIVACYCONSENT_FIELD_ARTICLE_LABEL="Privacy Article" diff --git a/components/com_config/src/Controller/ModulesController.php b/components/com_config/src/Controller/ModulesController.php index 97882c670d850..4aeabb544746e 100644 --- a/components/com_config/src/Controller/ModulesController.php +++ b/components/com_config/src/Controller/ModulesController.php @@ -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()); } /** @@ -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(); + } } diff --git a/layouts/joomla/form/field/list-fancy-select.php b/layouts/joomla/form/field/list-fancy-select.php index 344303b39d0b7..f117d34a9a96b 100644 --- a/layouts/joomla/form/field/list-fancy-select.php +++ b/layouts/joomla/form/field/list-fancy-select.php @@ -85,7 +85,7 @@ $html[] = ''; } } else { - $html[] = ''; + $html[] = ''; } } else // Create a regular list. { diff --git a/layouts/joomla/form/field/list.php b/layouts/joomla/form/field/list.php index 84114edfc8cb9..224107485943b 100644 --- a/layouts/joomla/form/field/list.php +++ b/layouts/joomla/form/field/list.php @@ -77,7 +77,7 @@ $html[] = ''; } } else { - $html[] = ''; + $html[] = ''; } } else // Create a regular list passing the arguments in an array. { diff --git a/libraries/src/Installer/Adapter/ModuleAdapter.php b/libraries/src/Installer/Adapter/ModuleAdapter.php index 8ab279c3fcbb9..57186cd67ce92 100644 --- a/libraries/src/Installer/Adapter/ModuleAdapter.php +++ b/libraries/src/Installer/Adapter/ModuleAdapter.php @@ -366,7 +366,7 @@ public function loadLanguage($path = null) $source = $path . '/' . $folder; } - $client = (string) $this->getManifest()->attributes()->client; + $client = (string) $this->getManifest()->attributes()->client ?: 'site'; $this->doLoadLanguage($extension, $source, \constant('JPATH_' . strtoupper($client))); } } diff --git a/libraries/src/Mail/MailerFactory.php b/libraries/src/Mail/MailerFactory.php index e9708ac28c7b8..fc91e620b6967 100644 --- a/libraries/src/Mail/MailerFactory.php +++ b/libraries/src/Mail/MailerFactory.php @@ -53,7 +53,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); diff --git a/modules/mod_articles_categories/src/Helper/ArticlesCategoriesHelper.php b/modules/mod_articles_categories/src/Helper/ArticlesCategoriesHelper.php index e1fb507376b62..86db1928bb9cb 100644 --- a/modules/mod_articles_categories/src/Helper/ArticlesCategoriesHelper.php +++ b/modules/mod_articles_categories/src/Helper/ArticlesCategoriesHelper.php @@ -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); diff --git a/plugins/system/cache/src/Extension/Cache.php b/plugins/system/cache/src/Extension/Cache.php index 92d980d2d0441..f94a0cb49dc4b 100644 --- a/plugins/system/cache/src/Extension/Cache.php +++ b/plugins/system/cache/src/Extension/Cache.php @@ -333,6 +333,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 !== ''; }; @@ -343,19 +344,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; + } + } } } ```