Skip to content

Commit

Permalink
#25 Fixes for security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thepaulfox committed Feb 21, 2024
1 parent 3a8748b commit 7dd5424
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/classes/CampaignCalendar.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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<Campaign> campaigns = (List<Campaign>)Database.query(query);

List<CalendarEntry> calendarEntries = new List<CalendarEntry>();
Expand Down
8 changes: 4 additions & 4 deletions src/pages/CampaignCalendar.page
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
<table width="100%">
<apex:repeat value="{!$ObjectType.Campaign.FieldSets.MarketingCalendarPopup}" var="f">
<tr>
{{if '{!f.FieldPath}' == 'OwnerId'}}
{{if '{!JSENCODE(f.FieldPath)}' == 'OwnerId'}}
<td><b>Owner</b></td>
<td>{{>Owner.Name}}</td>
{{else}}
<td><b>{!f.Label}</b></td>
<td class="{!f.FieldPath}" >
{{:~formatData({!f.FieldPath},'{!f.type}','{!f.FieldPath}')}}
<td><b>{!JSENCODE(f.Label)}</b></td>
<td class="{!JSENCODE(f.FieldPath)}" >
{{:~formatData({!JSENCODE(f.FieldPath)},'{!JSENCODE(f.type)}','{!JSENCODE(f.FieldPath)}')}}
</td>
{{/if}}
</tr>
Expand Down

0 comments on commit 7dd5424

Please sign in to comment.