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); } -