From f714e90d08cb1ff40b8c3628fd68a75d70a3b894 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 11 Nov 2021 13:04:58 +1300 Subject: [PATCH] Escape-on-output-proof enotice fixes --- CRM/Core/Form.php | 5 +++++ templates/CRM/Form/body.tpl | 2 +- templates/CRM/Form/default.tpl | 4 ++-- templates/CRM/common/CMSPrint.tpl | 4 ++-- templates/CRM/common/fatal.tpl | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index bd23babf00..4d82cc4a0a 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -262,6 +262,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @var string[] */ public $expectedSmartyVariables = [ + // in CMSPrint.tpl + 'breadcrumb', + 'pageTitle', + // in 'body.tpl + 'suppressForm', 'beginHookFormElements', // required for footer.tpl 'contactId', diff --git a/templates/CRM/Form/body.tpl b/templates/CRM/Form/body.tpl index b834269024..4f8e4667bf 100644 --- a/templates/CRM/Form/body.tpl +++ b/templates/CRM/Form/body.tpl @@ -15,7 +15,7 @@
{$form.hidden}
{/if} -{if ($snippet !== 'json') and empty($suppressForm) and count($form.errors) gt 0} +{if ($snippet !== 'json') and !$suppressForm and count($form.errors) gt 0}
{ts}Please correct the following errors in the form fields below:{/ts} diff --git a/templates/CRM/Form/default.tpl b/templates/CRM/Form/default.tpl index e9068d974f..ee947e9a35 100644 --- a/templates/CRM/Form/default.tpl +++ b/templates/CRM/Form/default.tpl @@ -7,7 +7,7 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if empty($suppressForm)} +{if !$suppressForm}
{crmRegion name='form-top'}{/crmRegion} {/if} @@ -18,7 +18,7 @@ {include file=$tplFile} {/crmRegion} -{if empty($suppressForm)} +{if !$suppressForm} {crmRegion name='form-bottom'}{/crmRegion}
{/if} diff --git a/templates/CRM/common/CMSPrint.tpl b/templates/CRM/common/CMSPrint.tpl index 8b43007374..fb4beb1ce3 100644 --- a/templates/CRM/common/CMSPrint.tpl +++ b/templates/CRM/common/CMSPrint.tpl @@ -13,7 +13,7 @@
-{if !empty($breadcrumb)} +{if $breadcrumb} {/if} -{if !empty($pageTitle)} +{if $pageTitle}

{if !empty($isDeleted)}{/if}{$pageTitle}{if !empty($isDeleted)}{/if}

diff --git a/templates/CRM/common/fatal.tpl b/templates/CRM/common/fatal.tpl index 4ee6936607..7e5a353656 100644 --- a/templates/CRM/common/fatal.tpl +++ b/templates/CRM/common/fatal.tpl @@ -13,7 +13,7 @@ - {if !empty($pageTitle)}{$pageTitle|escape}{/if} + {$pageTitle|escape}