Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
public class Execute implements freemarker.template.TemplateMethodModel {

private final static int OUTPUT_BUFFER_SIZE = 1024;
private final static boolean DISABLE_EXECUTE = SecurityUtilities.getSystemProperty("freemarker.template.disableExecute", null) != null;

/**
* Executes a method call.
Expand All @@ -74,6 +75,9 @@ public Object exec (List arguments) throws TemplateModelException {
String aExecute;
StringBuilder aOutputBuffer = new StringBuilder();

if ( DISABLE_EXECUTE ) {
throw new TemplateModelException( "Execution disabled" );
}
if ( arguments.size() < 1 ) {
throw new TemplateModelException( "Need an argument to execute" );
}
Expand Down