File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,11 @@ public function detectFalsyFunction(): bool
112
112
if (preg_match ('/&gd\.return\.identifier;/m ' , $ file )) {
113
113
return true ;
114
114
}
115
+ //used for date
116
+ if (preg_match ('/If a non-numeric value is used for
117
+ \<parameter\>timestamp\<\/parameter\>, &false; is returned/m ' , $ file )) {
118
+ return true ;
119
+ }
115
120
116
121
//used to detect imagecreatefromstring
117
122
if (preg_match ('/If the arguments are invalid, the function returns &false;/m ' , $ file )) {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public function testDetectFalsyFunction()
18
18
$ fsockopen = new DocPage (__DIR__ . '/../doc/doc-en/en/reference/network/functions/fsockopen.xml ' );
19
19
$ arrayReplace = new DocPage (__DIR__ . '/../doc/doc-en/en/reference/array/functions/array-replace.xml ' );
20
20
$ mktime = new DocPage (__DIR__ . '/../doc/doc-en/en/reference/datetime/functions/mktime.xml ' );
21
+ $ date = new DocPage (__DIR__ . '/../doc/doc-en/en/reference/datetime/functions/date.xml ' );
21
22
22
23
$ this ->assertTrue ($ pregMatch ->detectFalsyFunction ());
23
24
$ this ->assertFalse ($ implode ->detectFalsyFunction ());
@@ -29,6 +30,7 @@ public function testDetectFalsyFunction()
29
30
$ this ->assertTrue ($ fsockopen ->detectFalsyFunction ());
30
31
$ this ->assertFalse ($ arrayReplace ->detectFalsyFunction ());
31
32
$ this ->assertTrue ($ mktime ->detectFalsyFunction ());
33
+ $ this ->assertTrue ($ date ->detectFalsyFunction ());
32
34
}
33
35
34
36
public function testDetectNullsyFunction ()
You can’t perform that action at this time.
0 commit comments