Bugfix - Opening inexistent file
parent
ca3fba1758
commit
e280f50e0f
10
functions.py
10
functions.py
|
@ -103,9 +103,13 @@ def check_declaration(content, vuln, path):
|
||||||
# Path is the path of the current scanned file, we can use it to compute the relative include
|
# Path is the path of the current scanned file, we can use it to compute the relative include
|
||||||
for include in includes:
|
for include in includes:
|
||||||
relative_include = os.path.dirname(path)+"/"
|
relative_include = os.path.dirname(path)+"/"
|
||||||
path_include = relative_include + include[1]
|
try:
|
||||||
with open(path_include, 'r') as f:
|
path_include = relative_include + include[1]
|
||||||
content = f.read() + content
|
with open(path_include, 'r') as f:
|
||||||
|
content = f.read() + content
|
||||||
|
except Exception as e:
|
||||||
|
return (False, "","")
|
||||||
|
|
||||||
|
|
||||||
# Extract declaration - for ($something as $somethingelse)
|
# Extract declaration - for ($something as $somethingelse)
|
||||||
regex_declaration2 = re.compile("\$(.*?)([\t ]*)as(?!=)([\t ]*)\$"+vuln[1:])
|
regex_declaration2 = re.compile("\$(.*?)([\t ]*)as(?!=)([\t ]*)\$"+vuln[1:])
|
||||||
|
|
Loading…
Reference in New Issue