mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-18 22:20:22 +00:00
Fix for --sql-file with comment lines
This commit is contained in:
parent
b48a14a63b
commit
7827b2c389
2 changed files with 2 additions and 1 deletions
|
|
@ -152,6 +152,7 @@ class Custom(object):
|
|||
|
||||
# User SQL is not a bundled procedure template: preserve literals and percent tokens.
|
||||
snippet = readCachedFileContent(filename)
|
||||
snippet = "\n".join(_ for _ in snippet.split("\n") if not re.match(r"\s*(--|#)", _)) # Note: only whole comment lines (literals stay intact)
|
||||
queries = [_.strip() for _ in splitFields(snippet, delimiter=';' if zeroDepthSearch(snippet, ';') else '\n') if _.strip()]
|
||||
|
||||
if queries and all(query.upper().startswith("SELECT") for query in queries):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue