DDC-660: quoting not-in-values #5170

Closed
doctrinebot opened this Issue Jun 29, 2010 · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user dietmar:

There seems to be a bug in ORM/Query/expr.php method notIn. All literals should be quoted like:

    /****
     * Creates a NOT IN() expression with the given arguments.
     *
     * @param string $x Field in string format to be restricted by NOT IN() function
     * @param mixed $y Argument to be used in NOT IN() function.
     * @return Expr\Func
     */
    public function notIn($x, $y)
    {
        if (is_array($y)) {
            foreach ($y as &$literal) { 
                if ( ! ($literal instanceof Expr\Literal)) { 
                    $literal = $this->_quoteLiteral($literal);
                }
            }
        }
        return new Expr\Func($x . ' NOT IN', (array) $y);
    }
@doctrinebot

Comment created by dietmar:

Of course without "unknown macro" in the code!

@doctrinebot

Comment created by @beberlei:

this was fixed for the in() function already some time ago, good oversight ;)

@doctrinebot

Comment created by dietmar:

added { code } to description

@doctrinebot

Comment created by @beberlei:

fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0-BETA3 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment