From 27196c95d076e528bd4ce282eb2a2ea1aa38fdcb Mon Sep 17 00:00:00 2001 From: Brandon Shipley Date: Sun, 15 Nov 2026 01:41:15 -0800 Subject: [PATCH] csc --- src/Controller/Component/ContactUsComponent.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Controller/Component/ContactUsComponent.php b/src/Controller/Component/ContactUsComponent.php index 87fbcce..1a30574 100644 --- a/src/Controller/Component/ContactUsComponent.php +++ b/src/Controller/Component/ContactUsComponent.php @@ -83,12 +83,14 @@ class ContactUsComponent extends Component { $this->setConfig($config); parent::initialize($config); // TODO: Change the autogenerated stub $this->table = TableRegistry::getTableLocator()->get($this->getConfig('model')); - if (Configure::read('ContactUs.fields.turnstile') && - $this->getController()->components()->has('FormProtection') && - method_exists($this->getController()->components()->get('FormProtection'), 'unlockFields') - ) { - $this->getController()->components()->get('FormProtection') - ->unlockFields('cf-turnstile-response'); + if (!Configure::read('ContactUs.fields.turnstile')) { + return; + } + if (!$this->getController()->components()->has('FormProtection')) { + return; + } + if (method_exists($this->getController()->components()->get('FormProtection'), 'unlockFields')) { + $this->getController()->components()->get('FormProtection')->unlockFields('cf-turnstile-response'); } }