我有关于存储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);
}
在错误列表中,错误显示在我们用于循环的第一行。请为我提供解决方法。