From 5c739fcf7e0ca740994f3e426b58ec36123ceb24 Mon Sep 17 00:00:00 2001 From: frostmakk Date: Mon, 20 Dec 2021 16:42:54 +0100 Subject: [PATCH 1/5] administrator/components --- .../components/com_banners/src/Model/ClientsModel.php | 2 +- .../com_config/src/Controller/DisplayController.php | 2 +- .../components/com_fields/src/Plugin/FieldsPlugin.php | 6 +++--- .../components/com_finder/src/Indexer/Query.php | 5 +++++ .../components/com_mails/src/Model/TemplateModel.php | 11 ++++++++++- .../com_templates/src/View/Template/HtmlView.php | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/administrator/components/com_banners/src/Model/ClientsModel.php b/administrator/components/com_banners/src/Model/ClientsModel.php index da569440e06fc..84e35a2bf7b03 100644 --- a/administrator/components/com_banners/src/Model/ClientsModel.php +++ b/administrator/components/com_banners/src/Model/ClientsModel.php @@ -162,7 +162,7 @@ protected function getListQuery() ); // Filter by search in title - if ($search = trim($this->getState('filter.search'))) + if ($search = trim($this->getState('filter.search', ''))) { if (stripos($search, 'id:') === 0) { diff --git a/administrator/components/com_config/src/Controller/DisplayController.php b/administrator/components/com_config/src/Controller/DisplayController.php index 7a5b66263169a..2ed6a6f030c14 100644 --- a/administrator/components/com_config/src/Controller/DisplayController.php +++ b/administrator/components/com_config/src/Controller/DisplayController.php @@ -47,7 +47,7 @@ class DisplayController extends BaseController */ public function display($cachable = false, $urlparams = array()) { - $component = $this->input->get('component'); + $component = $this->input->get('component', ''); // Make sure com_joomlaupdate and com_privacy can only be accessed by SuperUser if (in_array(strtolower($component), array('com_joomlaupdate', 'com_privacy')) diff --git a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php index b72b54e3853e7..2c674e5a06cef 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php @@ -194,10 +194,10 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $node->setAttribute('name', $field->name); $node->setAttribute('type', $field->type); $node->setAttribute('label', $field->label); - $node->setAttribute('labelclass', $field->params->get('label_class')); + $node->setAttribute('labelclass', $field->params->get('label_class', '')); $node->setAttribute('description', $field->description); - $node->setAttribute('class', $field->params->get('class')); - $node->setAttribute('hint', $field->params->get('hint')); + $node->setAttribute('class', $field->params->get('class', '')); + $node->setAttribute('hint', $field->params->get('hint', '')); $node->setAttribute('required', $field->required ? 'true' : 'false'); if ($field->default_value !== '') diff --git a/administrator/components/com_finder/src/Indexer/Query.php b/administrator/components/com_finder/src/Indexer/Query.php index 5a5a652ac1cb3..8d0d0ea53e336 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -751,6 +751,11 @@ protected function processDates($date1, $date2, $when1, $when2) protected function processString($input, $lang, $mode) { // Clean up the input string. + if ($input === null) + { + $input = ''; + } + $input = html_entity_decode($input, ENT_QUOTES, 'UTF-8'); $input = StringHelper::strtolower($input); $input = preg_replace('#\s+#mi', ' ', $input); diff --git a/administrator/components/com_mails/src/Model/TemplateModel.php b/administrator/components/com_mails/src/Model/TemplateModel.php index ed81192e4fe48..b9e0fc3fec704 100644 --- a/administrator/components/com_mails/src/Model/TemplateModel.php +++ b/administrator/components/com_mails/src/Model/TemplateModel.php @@ -114,12 +114,21 @@ public function getForm($data = array(), $loadData = true) $form->removeField('copyto', 'params'); } - if (!trim($params->get('attachment_folder'))) + if ($params->get('attachment_folder') === null) { $form->removeField('attachments'); return $form; } + else + { + if (!trim($params->get('attachment_folder'))) + { + $form->removeField('attachments'); + + return $form; + } + } try { diff --git a/administrator/components/com_templates/src/View/Template/HtmlView.php b/administrator/components/com_templates/src/View/Template/HtmlView.php index 304646efaee61..e8eeca9291219 100644 --- a/administrator/components/com_templates/src/View/Template/HtmlView.php +++ b/administrator/components/com_templates/src/View/Template/HtmlView.php @@ -148,7 +148,7 @@ public function display($tpl = null) { $app = Factory::getApplication(); $this->file = $app->input->get('file'); - $this->fileName = InputFilter::getInstance()->clean(base64_decode($this->file), 'string'); + $this->fileName = InputFilter::getInstance()->clean(base64_decode($this->file ?? ''), 'string'); $explodeArray = explode('.', $this->fileName); $ext = end($explodeArray); $this->files = $this->get('Files'); From 9137ca6c1bbf42ccab78789f4da71c06e76e69bc Mon Sep 17 00:00:00 2001 From: frostmakk Date: Mon, 20 Dec 2021 19:50:48 +0100 Subject: [PATCH 2/5] 2 more --- .../components/com_menus/tmpl/items/default_batch_body.php | 2 +- .../components/com_menus/tmpl/items/default_batch_footer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_menus/tmpl/items/default_batch_body.php b/administrator/components/com_menus/tmpl/items/default_batch_body.php index a329cd86e2510..1717c34eb5fc7 100644 --- a/administrator/components/com_menus/tmpl/items/default_batch_body.php +++ b/administrator/components/com_menus/tmpl/items/default_batch_body.php @@ -31,7 +31,7 @@ } ?>
- +
diff --git a/administrator/components/com_menus/tmpl/items/default_batch_footer.php b/administrator/components/com_menus/tmpl/items/default_batch_footer.php index 0216c8c0e1bfa..1c59f2691e172 100644 --- a/administrator/components/com_menus/tmpl/items/default_batch_footer.php +++ b/administrator/components/com_menus/tmpl/items/default_batch_footer.php @@ -18,7 +18,7 @@ - 0 && $clientId == 1)): ?> + 0 && $clientId == 1)): ?> From c7ebf57057369d40ef161a844fc26847728dedd9 Mon Sep 17 00:00:00 2001 From: frostmakk Date: Wed, 22 Dec 2021 23:44:20 +0100 Subject: [PATCH 3/5] Update --- .../components/com_menus/tmpl/items/default_batch_body.php | 4 ++-- .../components/com_menus/tmpl/items/default_batch_footer.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/components/com_menus/tmpl/items/default_batch_body.php b/administrator/components/com_menus/tmpl/items/default_batch_body.php index 1717c34eb5fc7..acb8b8e97b71f 100644 --- a/administrator/components/com_menus/tmpl/items/default_batch_body.php +++ b/administrator/components/com_menus/tmpl/items/default_batch_body.php @@ -20,7 +20,7 @@ ]; $published = (int) $this->state->get('filter.published'); $clientId = (int) $this->state->get('filter.client_id'); -$menuType = Factory::getApplication()->getUserState('com_menus.items.menutype'); +$menuType = Factory::getApplication()->getUserState('com_menus.items.menutype', ''); if ($clientId == 1) { @@ -31,7 +31,7 @@ } ?>
- +
diff --git a/administrator/components/com_menus/tmpl/items/default_batch_footer.php b/administrator/components/com_menus/tmpl/items/default_batch_footer.php index 1c59f2691e172..e58750f8d495a 100644 --- a/administrator/components/com_menus/tmpl/items/default_batch_footer.php +++ b/administrator/components/com_menus/tmpl/items/default_batch_footer.php @@ -13,12 +13,12 @@ $published = $this->state->get('filter.published'); $clientId = $this->state->get('filter.client_id'); -$menuType = Factory::getApplication()->getUserState('com_menus.items.menutype'); +$menuType = Factory::getApplication()->getUserState('com_menus.items.menutype', ''); ?> - 0 && $clientId == 1)): ?> + 0 && $clientId == 1)): ?> From ca96efb23d99a4a980b66f9c42c5ad62da9b3d42 Mon Sep 17 00:00:00 2001 From: frostmakk Date: Thu, 23 Dec 2021 16:56:03 +0100 Subject: [PATCH 4/5] Moved comment --- administrator/components/com_finder/src/Indexer/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_finder/src/Indexer/Query.php b/administrator/components/com_finder/src/Indexer/Query.php index 8d0d0ea53e336..952dddb0cc169 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -750,12 +750,12 @@ protected function processDates($date1, $date2, $when1, $when2) */ protected function processString($input, $lang, $mode) { - // Clean up the input string. if ($input === null) { $input = ''; } + // Clean up the input string. $input = html_entity_decode($input, ENT_QUOTES, 'UTF-8'); $input = StringHelper::strtolower($input); $input = preg_replace('#\s+#mi', ' ', $input); From 4411509cc6817953d92a05f300c200c213ac09e7 Mon Sep 17 00:00:00 2001 From: frostmakk Date: Thu, 23 Dec 2021 19:01:54 +0100 Subject: [PATCH 5/5] Requested change --- .../components/com_mails/src/Model/TemplateModel.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/administrator/components/com_mails/src/Model/TemplateModel.php b/administrator/components/com_mails/src/Model/TemplateModel.php index b9e0fc3fec704..b8f27589b63df 100644 --- a/administrator/components/com_mails/src/Model/TemplateModel.php +++ b/administrator/components/com_mails/src/Model/TemplateModel.php @@ -114,21 +114,12 @@ public function getForm($data = array(), $loadData = true) $form->removeField('copyto', 'params'); } - if ($params->get('attachment_folder') === null) + if (!trim($params->get('attachment_folder', ''))) { $form->removeField('attachments'); return $form; } - else - { - if (!trim($params->get('attachment_folder'))) - { - $form->removeField('attachments'); - - return $form; - } - } try {