Skip to content

Commit 84c335a

Browse files
authored
Revert "Use isalnum (#43)"
This reverts commit b9a178e.
1 parent a574f23 commit 84c335a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/python/detectors/log_injection/log_injection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def logging_noncompliant():
1616
# {fact rule=log-injection@v1.0 defects=0}
1717
def logging_compliant():
1818
filename = input("Enter a filename: ")
19-
if filename.isalnum():
19+
if re.match(r'^[\w_ -\.]+$', filename):
2020
# Compliant: input is validated before logging.
2121
logger.info("Processing %s", filename)
2222
# {/fact}

0 commit comments

Comments
 (0)