Undefined index notice when writing an invalid expression #99

Closed
stof opened this Issue Jan 23, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@stof
Contributor

stof commented Jan 23, 2013

I got a notice when using the expression true (to check if it was working to allow anything, which is not the case). And I received an undefined index notice instead of a proper exception when running the check

@stof

This comment has been minimized.

Show comment Hide comment
@stof

stof Jan 23, 2013

Contributor

This is how the compiled code looks like:

<?php
// Expression: true
return function(array $context) {
    return $context['true'];
};
Contributor

stof commented Jan 23, 2013

This is how the compiled code looks like:

<?php
// Expression: true
return function(array $context) {
    return $context['true'];
};
@schmittjoh

This comment has been minimized.

Show comment Hide comment
@schmittjoh

schmittjoh Jan 23, 2013

Owner

The alias for true is "permitAll" for false "denyAll", but keep it open, we
can add some isset check before accessing a variable.

On Wed, Jan 23, 2013 at 12:23 PM, Christophe Coevoet <
notifications@github.com> wrote:

This is how the compiled code looks like:

Owner

schmittjoh commented Jan 23, 2013

The alias for true is "permitAll" for false "denyAll", but keep it open, we
can add some isset check before accessing a variable.

On Wed, Jan 23, 2013 at 12:23 PM, Christophe Coevoet <
notifications@github.com> wrote:

This is how the compiled code looks like:

@stof

This comment has been minimized.

Show comment Hide comment
@stof

stof Jan 23, 2013

Contributor

btw, VariableExpression has an allowNull flag (which adds an isset check) but it seems to be usable only when creating the instance manually, not when using a variable in an expression. Am I right ?

Contributor

stof commented Jan 23, 2013

btw, VariableExpression has an allowNull flag (which adds an isset check) but it seems to be usable only when creating the instance manually, not when using a variable in an expression. Am I right ?

stof added a commit to stof/JMSSecurityExtraBundle that referenced this issue Jan 31, 2013

stof added a commit to stof/JMSSecurityExtraBundle that referenced this issue Jan 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment