Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/5d7b04650ca62be724138dcc83d3e278 to your computer and use it in GitHub Desktop.
Save trycf/5d7b04650ca62be724138dcc83d3e278 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
//trycf has lucee.xmlfeatures.override.disable=true set
str= '<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping></hibernate-mapping>';
dump(isXml(str)); // only returns boolean
dump(isXml(str, {
"secure": true,
"disallowDoctypeDecl": true,
"externalGeneralEntities": false
})); // xmlfeatures override ignored
flush;
try {
dump( xmlParse( str, false, {
"secure": true,
"disallowDoctypeDecl": true,
"externalGeneralEntities": false
})); // xmlfeatures override ignored
} catch(e){
echo(e);
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment