mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
parser: Fix commented SecRule parser
No longer treat the next line as comment. Instead changes the parser state to comment and figure out what to do.
This commit is contained in:
parent
7d06c32b0d
commit
bad3e13612
@ -454,10 +454,8 @@ CONFIG_DIR_UNICODE_MAP_FILE (?i:SecUnicodeMapFile)
|
||||
}
|
||||
|
||||
[ \t]*[\n] { driver.loc.back()->lines(1); driver.loc.back()->step(); }
|
||||
#[ \t]*SecRule[^\\]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecRule[^\\]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecRule[^\\].*\\[ \t]*[\r\n]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#[ \t]*SecAction[^\\].*\\[ \t]*[^\\n] { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
|
||||
#.* { driver.loc.back()->step(); /* comment, just ignore. */ }
|
||||
. { driver.error (*driver.loc.back(), "invalid character", yytext); throw yy::seclang_parser::syntax_error(*driver.loc.back(), ""); }
|
||||
<<EOF>> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user