如何解决for循环静态查询中存储的xss错误

时间:2016-09-20 21:03:13

标签: javascript salesforce

我有关于存储xss的问题。我也在需要时使用JSENENCODE和escapeHtml4()。但仍然在以下代码中出错:

for(OpportunityStage stg : [select Id,APiName,defaultProbability,ForecastCategoryName,IsActive,MasterLabel,SortOrder from OpportunityStage where isActive = true  order by SortOrder ])
{
    lsttemp.add(String.escapeSingleQuotes(stg.APiName.escapeHtml4()));
    if(mapCategoryStages.containsKey(stg.ForecastCategoryName)) {
        lsttemp.addAll(mapCategoryStages.get(stg.ForecastCategoryName.escapeHtml4())));
    }
    mapCategoryStages.put(stg.ForecastCategoryName.escapeHtml4(),lsttemp); 
}

在错误列表中,错误显示在我们用于循环的第一行。请为我提供解决方法。

0 个答案:

没有答案