pmd / pmd/pmd

[vf] Id fields considered unescaped

Open
#1,092 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
5.5k
Forks
1.6k
Avg merge
1d 19h
Merged PRs (30d)
54

Description

Affects PMD Version: 6.3

Rule: VfUnescapeEl

Description:

ID type fields in Salesforce are very limited in character set so do not need escaping but are flagged as unescaped in VF Pages

Code Sample demonstrating the issue:

class myController {
public Id idVariable {get;set;}
}
<apex:page controller="myController" >
{!idVariable}
</apex:page>

Running PMD through: CLI

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the VfUnescapeEl rule and the provided Java controller and Visualforce page example. Run PMD through the CLI against this example, then verify that the Id field is no longer reported as unescaped while other fields remain covered by the rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.