Closed joomlapl-bot closed 7 months ago
PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/41333 Poniżej zmiany w oryginale:
PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/41333 Poniżej zmiany w oryginale:
Click to expand the diff!
```diff diff --git a/administrator/components/com_config/src/Controller/RequestController.php b/administrator/components/com_config/src/Controller/RequestController.php index 4ecd25cdeb5ef..889f3282f1b59 100644 --- a/administrator/components/com_config/src/Controller/RequestController.php +++ b/administrator/components/com_config/src/Controller/RequestController.php @@ -65,15 +65,12 @@ public function getJson() try { $data = $model->getData(); - $user = $this->app->getIdentity(); } catch (\Exception $e) { $this->app->enqueueMessage($e->getMessage(), 'error'); return false; } - $this->userIsSuperAdmin = $user->authorise('core.admin'); - // Required data $requiredData = [ 'sitename' => null, diff --git a/administrator/components/com_config/src/Dispatcher/Dispatcher.php b/administrator/components/com_config/src/Dispatcher/Dispatcher.php index 6874ee33ea6f9..97bfa3b44ca9f 100644 --- a/administrator/components/com_config/src/Dispatcher/Dispatcher.php +++ b/administrator/components/com_config/src/Dispatcher/Dispatcher.php @@ -36,8 +36,8 @@ class Dispatcher extends ComponentDispatcher */ protected function checkAccess(): void { - // sendtestmail expects json response, so we leave the method to handle the permission and send response itself - if ($this->input->getCmd('task') === 'application.sendtestmail') { + // sendtestmail and store do their own checks, so leave the method to handle the permission and send response itself + if (in_array($this->input->getCmd('task'), ['application.sendtestmail', 'application.store'], true)) { return; } diff --git a/administrator/components/com_finder/src/Indexer/Language/Zh.php b/administrator/components/com_finder/src/Indexer/Language/Zh.php index bfe598b52721a..5e8217e1d3301 100644 --- a/administrator/components/com_finder/src/Indexer/Language/Zh.php +++ b/administrator/components/com_finder/src/Indexer/Language/Zh.php @@ -11,7 +11,6 @@ namespace Joomla\Component\Finder\Administrator\Indexer\Language; use Joomla\Component\Finder\Administrator\Indexer\Language; -use Joomla\String\StringHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -61,26 +60,11 @@ public function __construct($locale = null) */ public function tokenise($input) { - $terms = parent::tokenise($input); - - // Iterate through the terms and test if they contain Chinese. - for ($i = 0, $n = count($terms); $i < $n; $i++) { - $charMatches = []; - $charCount = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches); - - // Split apart any groups of Chinese characters. - for ($j = 0; $j < $charCount; $j++) { - $tSplit = StringHelper::str_ireplace($charMatches[0][$j], '', $terms[$i], false); + // We first add whitespace around each Chinese character, so that our later code can easily split on this. + $input = preg_replace('#\p{Han}#mui', ' $0 ', $input); - if (!empty($tSplit)) { - $terms[$i] = $tSplit; - } else { - unset($terms[$i]); - } - - $terms[] = $charMatches[0][$j]; - } - } + // Now we split up the input into individual terms + $terms = parent::tokenise($input); return $terms; } diff --git a/administrator/components/com_guidedtours/src/Controller/DisplayController.php b/administrator/components/com_guidedtours/src/Controller/DisplayController.php index 3f83224df59c0..c5ef8a5738126 100644 --- a/administrator/components/com_guidedtours/src/Controller/DisplayController.php +++ b/administrator/components/com_guidedtours/src/Controller/DisplayController.php @@ -12,6 +12,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; // phpcs:disable PSR1.Files.SideEffects @@ -49,6 +50,11 @@ public function display($cachable = false, $urlparams = []) $layout = $this->input->get('layout', 'default'); $id = $this->input->getInt('id'); + // Show messages about the disabled plugin + if ($view === 'tours' && !PluginHelper::isEnabled('system', 'guidedtours')) { + $this->app->enqueueMessage(Text::_('COM_GUIDEDTOURS_PLUGIN_DISABLED'), 'error'); + } + if ($view === 'tour' && $layout === 'edit' && !$this->checkEditId('com_guidedtours.edit.tour', $id)) { $this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(Route::_('index.php?option=com_guidedtours&view=tours', false)); diff --git a/administrator/language/en-GB/com_guidedtours.ini b/administrator/language/en-GB/com_guidedtours.ini index a201bc70e1984..1e8d9cba02e20 100644 --- a/administrator/language/en-GB/com_guidedtours.ini +++ b/administrator/language/en-GB/com_guidedtours.ini @@ -42,6 +42,7 @@ COM_GUIDEDTOURS_N_ITEMS_UNPUBLISHED="%d items unpublished." COM_GUIDEDTOURS_NEW_TOUR="New Tour" COM_GUIDEDTOURS_ORDER_TYPE_ASC="Type ascending" COM_GUIDEDTOURS_ORDER_TYPE_DESC="Type descending" +COM_GUIDEDTOURS_PLUGIN_DISABLED="The Guided Tours System Plugin is disabled. The Guided Tours module will not be displayed if this is not enabled." COM_GUIDEDTOURS_STEP_DESCRIPTION_TRANSLATION="Description (%s)" COM_GUIDEDTOURS_STEP_EDIT_STEP="Edit Step" COM_GUIDEDTOURS_STEP_FILTER_SEARCH_DESC="Search in title and note. Prefix with ID: to search for a step ID or DESCRIPTION: to search in description." diff --git a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php index b0ed7434bf145..69d1fc7c06fb2 100644 --- a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php +++ b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php @@ -299,7 +299,7 @@ public function getButtons(Registry $params, CMSApplication $application = null) $this->buttons[$key][] = $tmp; } - if (ComponentHelper::isEnabled('com_contacts') && $params->get('show_contact')) { + if (ComponentHelper::isEnabled('com_contact') && $params->get('show_contact')) { $tmp = [ 'image' => 'icon-address-book contact', 'link' => Route::_('index.php?option=com_contact&view=contacts'), diff --git a/administrator/modules/mod_user/tmpl/default.php b/administrator/modules/mod_user/tmpl/default.php index 61ff2bf5ca61d..e72715932e44f 100644 --- a/administrator/modules/mod_user/tmpl/default.php +++ b/administrator/modules/mod_user/tmpl/default.php @@ -28,12 +28,12 @@