Skip to content

Commit

Permalink
Remove possibility to turn sandbox off via template
Browse files Browse the repository at this point in the history
  • Loading branch information
ebussieres committed May 18, 2020
1 parent b7d6374 commit c75c17a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
5 changes: 3 additions & 2 deletions docs/src/orchid/resources/changelog/v3_1_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ version: '3.1.4'
- Slice filter: Use collection size when toIndex is greater than collection size (#504)
- Adjust spring boot doc (#509)
- Build with jdk14 (#508)
- Set proxyBeanMethods to false (#507)
- Add access to Spring Beans/request/session and response when using Pebble with WebFlux (#512)
- Set proxyBeanMethods to false and build with spring boot 2.3 (#507)
- Add access to Spring Beans/request/session and response when using Pebble with WebFlux (#512)
- Remove allowUnsafeMethods property and replace it with methodAccessValidator. Default one is BlacklistMethodAccessValidtor (#511)
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,8 @@ public PebbleEngine build() {
parserOptions.setLiteralDecimalTreatedAsInteger(this.literalDecimalTreatedAsInteger);
parserOptions.setLiteralNumbersAsBigDecimals(this.literalNumbersAsBigDecimals);

EvaluationOptions evaluationOptions = new EvaluationOptions();
evaluationOptions.setMethodAccessValidator(this.methodAccessValidator);
evaluationOptions.setGreedyMatchMethod(this.greedyMatchMethod);

EvaluationOptions evaluationOptions = new EvaluationOptions(this.greedyMatchMethod,
this.methodAccessValidator);
return new PebbleEngine(this.loader, this.syntax, this.strictVariables, this.defaultLocale,
this.tagCache, this.templateCache,
this.executorService, extensionRegistry, parserOptions, evaluationOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,28 @@
* @author yanxiyue
*/
public class EvaluationOptions {

/**
* toggle to enable/disable greedy matching mode for finding java method
*/
private boolean greedyMatchMethod;
private final boolean greedyMatchMethod;

/**
* Validator that can be used to validate object/method access
*/
private MethodAccessValidator methodAccessValidator;
private final MethodAccessValidator methodAccessValidator;

public boolean isGreedyMatchMethod() {
return this.greedyMatchMethod;
public EvaluationOptions(boolean greedyMatchMethod,
MethodAccessValidator methodAccessValidator) {
this.greedyMatchMethod = greedyMatchMethod;
this.methodAccessValidator = methodAccessValidator;
}

public void setGreedyMatchMethod(boolean greedyMatchMethod) {
this.greedyMatchMethod = greedyMatchMethod;
public boolean isGreedyMatchMethod() {
return this.greedyMatchMethod;
}

public MethodAccessValidator getMethodAccessValidator() {
return this.methodAccessValidator;
}

public void setMethodAccessValidator(
MethodAccessValidator methodAccessValidator) {
this.methodAccessValidator = methodAccessValidator;
}
}

0 comments on commit c75c17a

Please sign in to comment.