Replace is_resource with different than false

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>
This commit is contained in:
Maurício Meneghini Fauth 2023-09-28 19:18:25 -03:00
parent 2a96c4b98e
commit 5a79ac768d
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8

View File

@ -17,7 +17,6 @@ use function feof;
use function fgets;
use function fwrite;
use function htmlspecialchars;
use function is_resource;
use function proc_close;
use function proc_open;
use function sprintf;
@ -140,7 +139,7 @@ abstract class ExternalTransformationsPlugin extends TransformationsPlugin
],
];
$process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes);
if (is_resource($process)) {
if ($process !== false) {
fwrite($pipes[0], $buffer);
fclose($pipes[0]);