From 7dd54246e13ddbfffd16c51d5776ffbb9de15e45 Mon Sep 17 00:00:00 2001 From: Paul Fox Date: Tue, 20 Feb 2024 19:29:09 -0700 Subject: [PATCH] #25 Fixes for security issues --- src/classes/CampaignCalendar.cls | 2 +- src/pages/CampaignCalendar.page | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/classes/CampaignCalendar.cls b/src/classes/CampaignCalendar.cls index 1b32595..42a34cc 100644 --- a/src/classes/CampaignCalendar.cls +++ b/src/classes/CampaignCalendar.cls @@ -115,7 +115,7 @@ public with sharing class CampaignCalendar { whereClause += ' AND Type = :type '; } - String query = 'SELECT ' + String.join(queryFields(), ',') + ' FROM Campaign WHERE ' + whereClause + ' WITH SECURITY_ENFORCED'; + String query = 'SELECT ' + String.escapeSingleQuotes(String.join(queryFields(), ',')) + ' FROM Campaign WHERE ' + whereClause + ' WITH SECURITY_ENFORCED'; List campaigns = (List)Database.query(query); List calendarEntries = new List(); diff --git a/src/pages/CampaignCalendar.page b/src/pages/CampaignCalendar.page index ef4602d..a074c4a 100644 --- a/src/pages/CampaignCalendar.page +++ b/src/pages/CampaignCalendar.page @@ -53,13 +53,13 @@ - {{if '{!f.FieldPath}' == 'OwnerId'}} + {{if '{!JSENCODE(f.FieldPath)}' == 'OwnerId'}} {{else}} - - + {{/if}}
Owner {{>Owner.Name}}{!f.Label} - {{:~formatData({!f.FieldPath},'{!f.type}','{!f.FieldPath}')}} + {!JSENCODE(f.Label)} + {{:~formatData({!JSENCODE(f.FieldPath)},'{!JSENCODE(f.type)}','{!JSENCODE(f.FieldPath)}')}}