Affects PMD Version:
6.25.0
Rule:
VfUnescapeEl
Description:
There's a new feature called Lightning Message Service that is surfaced through a global variable $MessageChannel
. The only way to access it is to bind to it in Visualforce markup.
This produces a false positive when PMD encounters this, as there's no reason to escape this content. It could never be entered by a user.
Docs: https://developer.salesforce.com/docs/atlas.en-us.222.0.pages.meta/pages/pages_variables_global_messagechannel.htm and https://developer.salesforce.com/docs/atlas.en-us.222.0.pages.meta/pages/message_channel_intro.htm
Code Sample demonstrating the issue:
<script type="text/javascript"> // Binding message channel to variable accessible to static resource. window.util = { messageChannel: '{!$MessageChannel.Record_Selected__c}' }; </script>
Expected outcome:
This usage should produce no rule violations with PMD. I believe it should be included in the list of safe global variable found here:
switch (lowerCaseId) { case "$action": case "$page": case "$site": case "$resource": case "$label": case "$objecttype": case "$component": case "$remoteaction":Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Other
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4