Skip to content

Commit f023231

Browse files
committed
FIX: edited the regexp to detect get_headers and ldap_search
1 parent ddd4ccc commit f023231

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

generator/src/DocPage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ public function detectFalsyFunction(): bool
128128
return true;
129129
}
130130

131+
//used to detect get_headers and ldap_search
132+
if (preg_match("/&false; on failure/m", $file)) {
133+
return true;
134+
}
135+
131136
return false;
132137
}
133138

generator/tests/DocPageTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public function testDetectFalsyFunction()
1919
$mktime = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/datetime/functions/mktime.xml');
2020
$date = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/datetime/functions/date.xml');
2121
$classImplement = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/spl/functions/class-implements.xml');
22+
$getHeaders = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/url/functions/get-headers.xml');
23+
$ldapSearch = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/ldap/functions/ldap-search.xml');
2224

2325
$this->assertTrue($pregMatch->detectFalsyFunction());
2426
$this->assertFalse($implode->detectFalsyFunction());
@@ -31,6 +33,8 @@ public function testDetectFalsyFunction()
3133
$this->assertTrue($mktime->detectFalsyFunction());
3234
$this->assertTrue($date->detectFalsyFunction());
3335
$this->assertTrue($classImplement->detectFalsyFunction());
36+
$this->assertTrue($getHeaders->detectFalsyFunction());
37+
$this->assertTrue($ldapSearch->detectFalsyFunction());
3438
}
3539

3640
public function testDetectNullsyFunction()

0 commit comments

Comments
 (0)