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
112112 if (preg_match ('/&gd\.return\.identifier;/m ' , $ file )) {
113113 return true ;
114114 }
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+ }
115120
116121 //used to detect imagecreatefromstring
117122 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()
1818 $ fsockopen = new DocPage (__DIR__ . '/../doc/doc-en/en/reference/network/functions/fsockopen.xml ' );
1919 $ arrayReplace = new DocPage (__DIR__ . '/../doc/doc-en/en/reference/array/functions/array-replace.xml ' );
2020 $ 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 ' );
2122
2223 $ this ->assertTrue ($ pregMatch ->detectFalsyFunction ());
2324 $ this ->assertFalse ($ implode ->detectFalsyFunction ());
@@ -29,6 +30,7 @@ public function testDetectFalsyFunction()
2930 $ this ->assertTrue ($ fsockopen ->detectFalsyFunction ());
3031 $ this ->assertFalse ($ arrayReplace ->detectFalsyFunction ());
3132 $ this ->assertTrue ($ mktime ->detectFalsyFunction ());
33+ $ this ->assertTrue ($ date ->detectFalsyFunction ());
3234 }
3335
3436 public function testDetectNullsyFunction ()
You can’t perform that action at this time.
0 commit comments