Skip to content

Commit

Permalink
fixed 'The handle is invalid.' bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 29, 2023
1 parent 12ef25e commit 2cb1b3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BypassFinals.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class BypassFinals
/** @var resource|null */
public $context;

/** @var resource|null */
public $handle;

/** @var object|null */
private $wrapper;

Expand Down Expand Up @@ -76,6 +79,7 @@ public function stream_open(string $path, string $mode, int $options, ?string &$
if (!$this->wrapper->stream_open($path, $mode, $options, $openedPath)) {
return false;
}
$this->handle = $this->wrapper->handle;

if ($mode === 'rb' && pathinfo($path, PATHINFO_EXTENSION) === 'php' && self::isPathInWhiteList($path)) {
$content = '';
Expand Down

0 comments on commit 2cb1b3c

Please sign in to comment.