Skip to content

Commit f15f219

Browse files
authored
Merge pull request #29 from cloudanswers/27-security-fixes
#27 Fixes for security issues
2 parents 3a8748b + f120c70 commit f15f219

File tree

4 files changed

+8001
-4533
lines changed

4 files changed

+8001
-4533
lines changed

src/classes/CampaignCalendar.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public with sharing class CampaignCalendar {
115115
whereClause += ' AND Type = :type ';
116116
}
117117

118-
String query = 'SELECT ' + String.join(queryFields(), ',') + ' FROM Campaign WHERE ' + whereClause + ' WITH SECURITY_ENFORCED';
118+
String query = 'SELECT ' + String.escapeSingleQuotes(String.join(queryFields(), ',')) + ' FROM Campaign WHERE ' + whereClause + ' WITH SECURITY_ENFORCED';
119119
List<Campaign> campaigns = (List<Campaign>)Database.query(query);
120120

121121
List<CalendarEntry> calendarEntries = new List<CalendarEntry>();

src/pages/CampaignCalendar.page

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
<table width="100%">
5454
<apex:repeat value="{!$ObjectType.Campaign.FieldSets.MarketingCalendarPopup}" var="f">
5555
<tr>
56-
{{if '{!f.FieldPath}' == 'OwnerId'}}
56+
{{if '{!JSENCODE(f.FieldPath)}' == 'OwnerId'}}
5757
<td><b>Owner</b></td>
5858
<td>{{>Owner.Name}}</td>
5959
{{else}}
60-
<td><b>{!f.Label}</b></td>
61-
<td class="{!f.FieldPath}" >
62-
{{:~formatData({!f.FieldPath},'{!f.type}','{!f.FieldPath}')}}
60+
<td><b>{!JSENCODE(f.Label)}</b></td>
61+
<td class="{!JSENCODE(f.FieldPath)}" >
62+
{{:~formatData({!JSENCODE(f.FieldPath)},'{!JSENCODE(f.type)}','{!JSENCODE(f.FieldPath)}')}}
6363
</td>
6464
{{/if}}
6565
</tr>
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)