此規則會偵測是否使用 WebLogic setAttribute 和 getAttribute 屬性來剖析 XML。 此規則會偵測 Java 程式碼。 個別規則會偵測是否使用啟用了此特性的 WebLogic weblogic.servlet.XMLParsingHelper。
範例:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", someObject)
範例:
String handler = "org.xml.sax.helpers.DefaultHandler";
request.setAttribute(handler, someObject);
範例: Document myDocument = request.getAttribute("org.w3c.dom.Document")
範例:
String handler = "org.w3c.dom.Document";
Document myDoc = request.getAttribute(handler);
範例:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", myHandler);
request.getAttribute("org.w3c.dom.Document");
當自動修正套用到之前的行時,這些行會被刪除。
注意:驗證物件、
myHandler
, 以其他方式初始化,如果稍後在程式碼中使用它。
範例:
Document myDocument = request.getAttribute("org.w3c.dom.Document");
當應用自動修復時,之前的代碼會變更為:
Document myDocument;
注意:驗證物件、
myDocument
, 以其他方式初始化,如果稍後在程式碼中使用它。