[
https://issues.apache.org/jira/browse/VELOCITY-618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637246#action_12637246
]
Nathan Bubna commented on VELOCITY-618:
---------------------------------------
Thanks. the RuntimeMacro change looks good. I'm skeptical of the reference
escaping changes you added though, since it changes the way escaping works.
Our confusing-yet-long-standing "escaping" support is and always has been for
escaping valid references. "Valid references" are defined as those which are
syntactically correct and have a defined value (in practice, this has meant "a
non-null value"). So, you can only legitimately escape things that are
syntactically correct and non-null. In my understanding, this "strict
reference mode" should only change the way Velocity handles invalid references,
not the definition of valid. So, whether the reference is escaped or not,
should not change whether or not we throw an exception in strict mode.
> Strict property and method references
> -------------------------------------
>
> Key: VELOCITY-618
> URL: https://issues.apache.org/jira/browse/VELOCITY-618
> Project: Velocity
> Issue Type: Improvement
> Components: Engine
> Reporter: Byron Foster
> Fix For: 1.5.1, 1.6
>
> Attachments: MacroAndVarEscape.patch,
> strictPropertyAndVariable_3.patch
>
>
> The given patch against trunk adds a new option 'runtime.references.strict'.
> When set to true, invalid property references will throw a
> InvalidMethodException. For example $foo.bar will throw an exception if the
> object contained in $foo has no such property as bar. Any kind of reference
> to bar will cause an exception including:
> #if(#foo.bar)
> #set($foo.bar = "junk")
> #set($foo.getBar())
> etc...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]