Skip to content

conditional query false positive #319

@staabm

Description

@staabm

in conditons like

        $select = 'SELECT `watchlist`.* FROM `watchlist` WHERE (send = ?) AND (kindid = ?)';
        $values = [0, $this->determineKindid()];

        $adaFilter = '';

        $userSession = ClxProductNet_UserSession::getInstance();
        if (is_object($userSession->ada)) {
            $adaFilter = ' AND (adaid = ?)';
            $values[] = $userSession->ada->getAdaid();
        }

        $sessionFilter = ' AND (sessionid = ?)';
        $values[] = ClxProductNet_SessionNS::getId();

        $select .= $adaFilter.$sessionFilter;

        return $this->fetchRowByStatement(new ClxProductNet_DbStatement($select, $values));

we see errors like Query expects 2 placeholders, but 3-4 values are given.
-> the query expect 3-4 placeholders

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions