/** * @param wfWAFLexerToken $token * @param string $message * @throws wfWAFParserSyntaxError */ protected function triggerSyntaxError($token, $message = 'Wordfence WAF Syntax Error: Unexpected %s %s found on line %d, column %d') { $e = new wfWAFParserSyntaxError(sprintf($message, $token->getType(), $token->getValue(), $token->getLine(), $token->getColumn())); $e->setToken($token); $e->setParseLine($token->getLine()); $e->setParseColumn($token->getColumn()); throw $e; }
/** * @param wfWAFLexerToken $token * @return bool */ private function isValidNonKeywordIdentifier($token) { return $token && ($token->getType() === wfWAFSQLiLexer::QUOTED_IDENTIFIER || $token->getType() === wfWAFSQLiLexer::UNQUOTED_IDENTIFIER && !$this->isKeywordToken($token)); }
/** * @param wfWAFLexerToken $token * @return bool */ protected function isCommentToken($token) { return $token->getType() === wfWAFRuleLexer::T_MULTIPLE_LINE_COMMENT || $token->getType() === wfWAFRuleLexer::T_SINGLE_LINE_COMMENT; }