From 780e53dd562aded9b6a68d934dbdd0f74b246ac4 Mon Sep 17 00:00:00 2001 From: BlBana <635373043@qq.com> Date: Wed, 6 Sep 2017 18:48:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=B9=E9=85=8D=E4=B8=8D=E5=B8=A6=E6=8B=AC?= =?UTF-8?q?=E5=8F=B7=E7=9A=84print=E5=92=8Cecho?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cobra/const.py | 2 +- tests/{vulnerabilities => examples}/v_parser.php | 0 tests/test_parser.py | 2 +- tests/vulnerabilities/v.php | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) rename tests/{vulnerabilities => examples}/v_parser.php (100%) diff --git a/cobra/const.py b/cobra/const.py index 6bff31fb..2e0d0940 100644 --- a/cobra/const.py +++ b/cobra/const.py @@ -31,7 +31,7 @@ # eval ($test + $test2); # call_function ($exp); # -fpc = '\s*\((.*)(?:\))' +fpc = '(\s*\((.*)(?:\))|\s*(.*\.)*\$.+)' fpc_single = '[f]{fpc}'.format(fpc=fpc) fpc_multi = '(?:[f]){fpc}'.format(fpc=fpc) diff --git a/tests/vulnerabilities/v_parser.php b/tests/examples/v_parser.php similarity index 100% rename from tests/vulnerabilities/v_parser.php rename to tests/examples/v_parser.php diff --git a/tests/test_parser.py b/tests/test_parser.py index 5b42e245..222bcf10 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -16,7 +16,7 @@ from cobra.config import project_directory -target_projects = project_directory + '/tests/vulnerabilities/v_parser.php' +target_projects = project_directory + '/tests/examples/v_parser.php' with open(target_projects, 'r') as fi: code_contents = fi.read() diff --git a/tests/vulnerabilities/v.php b/tests/vulnerabilities/v.php index f326bd01..29cda0cf 100644 --- a/tests/vulnerabilities/v.php +++ b/tests/vulnerabilities/v.php @@ -99,4 +99,3 @@ function curl($url){ if (!empty($file)){ unlink($file); } -