NOT(..) is a safe evaluation
This commit is contained in:
@ -145,7 +145,7 @@ PARSER_END(VfParser)
|
||||
| <GE: ">=" >
|
||||
| <LT: "<" >
|
||||
| <GT: ">" >
|
||||
| <EXCL: ("!"|"~"|"NOT") >
|
||||
| <EXCL: ("!"|"~") >
|
||||
| <PIPE_PIPE: "||" >
|
||||
| <STRING_LITERAL: <QUOTED_STRING> >
|
||||
| <DIGITS: (<NUM_CHAR>)+ (<DOT> (<NUM_CHAR>)+)? >
|
||||
@ -476,10 +476,10 @@ void UnaryExpression() #void :
|
||||
{}
|
||||
{
|
||||
( <PLUS> | <MINUS> ) UnaryExpression()
|
||||
| UnaryExpressionNotPlusMinus()
|
||||
| NegationExpression()
|
||||
}
|
||||
|
||||
void UnaryExpressionNotPlusMinus() #void :
|
||||
void NegationExpression() #void :
|
||||
{}
|
||||
{
|
||||
( <EXCL> ) UnaryExpression()
|
||||
|
@ -93,5 +93,5 @@ public class VfParserVisitorAdapter implements VfParserVisitor {
|
||||
public Object visit(ASTContent node, Object data) {
|
||||
return visit((VfNode) node, data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -230,20 +230,24 @@ public class VfUnescapeElRule extends AbstractVfRule {
|
||||
if (expression != null) {
|
||||
final ASTIdentifier id = expression.getFirstChildOfType(ASTIdentifier.class);
|
||||
if (id != null) {
|
||||
switch (id.getImage().toLowerCase()) {
|
||||
case "$component":
|
||||
case "$objecttype":
|
||||
case "$label":
|
||||
case "$resource":
|
||||
case "urlfor":
|
||||
case "$site":
|
||||
case "$page":
|
||||
case "$action":
|
||||
case "casesafeid":
|
||||
case "$remoteaction":
|
||||
return true;
|
||||
List<ASTArguments> args = expression.findChildrenOfType(ASTArguments.class);
|
||||
if (!args.isEmpty()) {
|
||||
switch (id.getImage().toLowerCase()) {
|
||||
case "$component":
|
||||
case "$objecttype":
|
||||
case "$label":
|
||||
case "$resource":
|
||||
case "urlfor":
|
||||
case "$site":
|
||||
case "$page":
|
||||
case "$action":
|
||||
case "casesafeid":
|
||||
case "not":
|
||||
case "$remoteaction":
|
||||
return true;
|
||||
|
||||
default:
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,5 +557,20 @@ Safe unquoted followed by safe quoted
|
||||
]]></code>
|
||||
<source-type>vf</source-type>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description><![CDATA[
|
||||
NOT method evaluates to safe boolean
|
||||
]]></description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
<apex:page>
|
||||
<script>
|
||||
if({!NOT(yes)}) { maskFormEls(); }
|
||||
</script>
|
||||
</apex:page>
|
||||
]]></code>
|
||||
<source-type>vf</source-type>
|
||||
</test-code>
|
||||
|
||||
|
||||
</test-data>
|
||||
|
Reference in New Issue
Block a user