Skip to content

Commit b114fe3

Browse files
committed
PHP regex tweak
1 parent 69df790 commit b114fe3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

assemblyline/common/identify.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
'code/php': [
4949
re.compile(rb'(^|\n)<\?php'),
5050
re.compile(rb'namespace[ \t]+[\w.]+'),
51-
re.compile(rb'function[ \t]+\w+[ \t]*\([ \t]*\$[^)]+\)[ \t]*{'),
51+
re.compile(rb'function[ \t]+\w+[ \t]*\([ \t]*\$[^)]+\)[ \t\n]*{'),
5252
re.compile(rb'\beval[ \t]*\('),
5353
],
5454
'code/c': [

test/test_identify.py

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def test_constants():
120120
(b"function\tblah\t(\t$b\t)\t{", ["code/php"]),
121121
(b"function blah($){", []),
122122
(b"functionblah($b){", []),
123+
(b"function blah($b)\n{", ["code/php"]),
123124
(b"eval(", ["code/javascript", "code/php"]),
124125
(b"eval (", ["code/javascript", "code/php"]),
125126
(b"eval\t(", ["code/javascript", "code/php"]),

0 commit comments

Comments
 (0)