Skip to content

Commit

Permalink
Replace is_resource with different than false
Browse files Browse the repository at this point in the history
This will avoid an issue when proc_open will return an object instead of
a resource in future PHP versions.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Sep 28, 2023
1 parent 2a96c4b commit 5a79ac7
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use function fgets;
use function fwrite;
use function htmlspecialchars;
use function is_resource;
use function proc_close;
use function proc_open;
use function sprintf;
Expand Down Expand Up @@ -140,7 +139,7 @@ public function applyTransformation($buffer, array $options = [], ?FieldMetadata
],
];
$process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes);
if (is_resource($process)) {
if ($process !== false) {
fwrite($pipes[0], $buffer);
fclose($pipes[0]);

Expand Down

0 comments on commit 5a79ac7

Please sign in to comment.