Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #92 from wufeifei/develop
Browse files Browse the repository at this point in the history
improves rules
  • Loading branch information
FeeiCN authored Sep 10, 2016
2 parents ee4795c + 8193bec commit 8ae911c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engine/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ def get_code(self, line_rule):
def is_controllable_param(self):
logging.info('---------------------- [2]. Param is controllable --------------------------------------')
param_name = re.findall(self.rule, self.code)
param_name = param_name[0].strip()
self.param_name = param_name
if len(param_name) == 1:
param_name = param_name[0].strip()
self.param_name = param_name
logging.info('P: {0}'.format(param_name))
# controllable param
# exclude class const (maybe misuse)
Expand Down Expand Up @@ -214,6 +214,7 @@ def is_controllable_param(self):
if len(c_rule_result) >= 1:
logging.info("R: True (New rule: controllable param: {0}, {1})".format(param_name, c_rule['example']))
return True
logging.info("R: True")
return True
else:
logging.info("R: False (Not contained $)")
Expand Down Expand Up @@ -245,7 +246,7 @@ def is_repair(self, repair_rule, block_repair):
try:
parse = Parse('curl_setopt\s?\(.*,\s?CURLOPT_URL\s?,(.*)\)', '/Volumes/Statics/Project/Company/mogujie/appbeta/classes/crond/trade/chenxitest.php', '60', "curl_setopt($curl, CURLOPT_URL, $file); #output")
if parse.is_controllable_param():
parse.is_repair(r'fff', 2)
parse.is_repair(r'$url', 2)
else:
print("UC")
except Exception as e:
Expand Down

0 comments on commit 8ae911c

Please sign in to comment.