Skip to content

Commit f22e88e

Browse files
author
Evell Lam
committed
Use endswith instead of in to look for execute aliases
1 parent a9e9289 commit f22e88e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

py_find_injection/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66

77
version_info = (0, 1, 1)
8-
__version__ = '0.1.1+dd.3'
8+
__version__ = '0.1.1+dd.4'
99

1010

1111
def stringify(node):
@@ -77,7 +77,8 @@ def check_execute(self, node):
7777

7878
def visit_Call(self, node):
7979
function_name = stringify(node.func)
80-
if '.execute' in function_name.lower():
80+
# catch and check aliases of session.execute and cursor.execute
81+
if function_name.lower().endswith('.execute'):
8182
try:
8283
node.args[0].parent = node
8384
node_error = self.check_execute(node.args[0])

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="py-find-injection",
6-
version="0.1.1+dd.3",
6+
version="0.1.1+dd.4",
77
author="James Brown",
88
author_email="jbrown@uber.com",
99
url="https://github.com/uber/py-find-injection",

0 commit comments

Comments
 (0)