From 3dc483eded631b7c2c76b6925d30b3acb6343deb Mon Sep 17 00:00:00 2001 From: Peter Macej Date: Tue, 9 Oct 2018 20:00:51 +0200 Subject: [PATCH] version 1.1.1, included security fix [20181001] from Joomla 3.8.13 --- .../contactformenhancer.xml | 2 +- .../com_contact/controllers/contact.php | 29 ++++++++++++++++++- server/plg_contactformenhancer_update.xml | 4 +-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/plg_contactformenhancer/contactformenhancer.xml b/plg_contactformenhancer/contactformenhancer.xml index 6505b80..acfb0db 100644 --- a/plg_contactformenhancer/contactformenhancer.xml +++ b/plg_contactformenhancer/contactformenhancer.xml @@ -13,7 +13,7 @@ GNU General Public License version 2 or later; see LICENSE.txt http://petermacej.github.io/contactform_enh/ - 1.1 + 1.1.1 PLG_SYSTEM_CONTACTFORMENHANCER_DESCR diff --git a/plg_contactformenhancer/override/com_contact/controllers/contact.php b/plg_contactformenhancer/override/com_contact/controllers/contact.php index 399962a..a0bb87c 100644 --- a/plg_contactformenhancer/override/com_contact/controllers/contact.php +++ b/plg_contactformenhancer/override/com_contact/controllers/contact.php @@ -75,9 +75,36 @@ public function submit() // Get the data from POST $data = $this->input->post->get('jform', array(), 'array'); + + // Get item + $model->setState('filter.published', 1); $contact = $model->getItem($id); - $params->merge($contact->params); + // Get item params, take menu parameters into account if necessary + $active = $app->getMenu()->getActive(); + $stateParams = clone $model->getState()->get('params'); + + // If the current view is the active item and a contact view for this contact, then the menu item params take priority + if ($active && strpos($active->link, 'view=contact') && strpos($active->link, '&id=' . (int) $contact->id)) + { + // $item->params are the contact params, $temp are the menu item params + // Merge so that the menu item params take priority + $contact->params->merge($stateParams); + } + else + { + // Current view is not a single contact, so the contact params take priority here + $stateParams->merge($contact->params); + $contact->params = $stateParams; + } + + // Check if the contact form is enabled + if (!$contact->params->get('show_email_form')) + { + $this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id=' . $stub, false)); + + return false; + } // Check for a valid session cookie if ($params->get('validate_session', 0)) diff --git a/server/plg_contactformenhancer_update.xml b/server/plg_contactformenhancer_update.xml index a188390..576e96f 100644 --- a/server/plg_contactformenhancer_update.xml +++ b/server/plg_contactformenhancer_update.xml @@ -6,9 +6,9 @@ plugin system 0 - 1.1.0 + 1.1.1 - https://github.com/PeterMacej/contactform_enh/releases/download/v1.1.0/plg_contactformenhancer_v1.1.0.zip + https://github.com/PeterMacej/contactform_enh/releases/download/v1.1.1/plg_contactformenhancer_v1.1.1.zip Peter Macej http://petermacej.github.io/contactform_enh/