Skip to content

Commit 8604bd7

Browse files
authored
Merge pull request #30 from Codeception/SamMousa-patch-1
Fix `TypeError` in PHP8
2 parents b7406c7 + 9e6703a commit 8604bd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Codeception/Lib/InnerBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ static function (Crawler $node) use ($attr, $val) {
14301430

14311431
public function grabTextFrom($cssOrXPathOrRegex)
14321432
{
1433-
if (@preg_match($cssOrXPathOrRegex, $this->client->getInternalResponse()->getContent(), $matches)) {
1433+
if (is_string($cssOrXPathOrRegex) && @preg_match($cssOrXPathOrRegex, $this->client->getInternalResponse()->getContent(), $matches)) {
14341434
return $matches[1];
14351435
}
14361436
$nodes = $this->match($cssOrXPathOrRegex);

0 commit comments

Comments
 (0)