Skip to content

Commit ca210a2

Browse files
author
Alexander Xu Chen
authored
made resolveExternalEntities depend of workspace trust (#545)
1 parent 47cd55a commit ca210a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/settings/settings.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ export function getXMLSettings(javaHome: string | undefined, logfile: string, ex
222222
enabled: workspace.getConfiguration('redhat.telemetry').get('enabled', false)
223223
};
224224

225+
// Check workspace trust
226+
const isWorkspaceTrusted = (workspace as any).isTrusted;
227+
if (isWorkspaceTrusted !== undefined && !isWorkspaceTrusted) {
228+
xml['xml']['validation']['resolveExternalEntities'] = false;
229+
} else {
230+
xml['xml']['validation']['resolveExternalEntities'] = workspace.getConfiguration('xml').get('validation.resolveExternalEntities', false);
231+
}
232+
225233
//applying externalXmlSettings to the xmlSettings
226234
externalXmlSettings.xmlCatalogs.forEach(catalog => {
227235
if (!xml['xml']['catalogs'].includes(catalog)) {

0 commit comments

Comments
 (0)