예제 #1
0
파일: lexer.php 프로젝트: ashenkar/sanga
 /**
  * @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;
 }
예제 #2
0
파일: sqli.php 프로젝트: ashenkar/sanga
 /**
  * @param wfWAFLexerToken $token
  * @return bool
  */
 private function isValidNonKeywordIdentifier($token)
 {
     return $token && ($token->getType() === wfWAFSQLiLexer::QUOTED_IDENTIFIER || $token->getType() === wfWAFSQLiLexer::UNQUOTED_IDENTIFIER && !$this->isKeywordToken($token));
 }
예제 #3
0
파일: parser.php 프로젝트: ashenkar/sanga
 /**
  * @param wfWAFLexerToken $token
  * @return bool
  */
 protected function isCommentToken($token)
 {
     return $token->getType() === wfWAFRuleLexer::T_MULTIPLE_LINE_COMMENT || $token->getType() === wfWAFRuleLexer::T_SINGLE_LINE_COMMENT;
 }