From 20c0bfb4375d414c3b94265c4085c162cc670344 Mon Sep 17 00:00:00 2001 From: wozulong Date: Thu, 20 Feb 2025 13:08:05 +0800 Subject: [PATCH] FIX: Filter non-scalar env values to prevent PHP 8.2 proc_open warnings PHP 8.2+ throws "Array to string conversion" warning when proc_open receives environment variables containing non-scalar values. Added filtering to ensure only scalar values are passed. --- Crypt/GPG/Engine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Crypt/GPG/Engine.php b/Crypt/GPG/Engine.php index 62eade4..9ff743d 100644 --- a/Crypt/GPG/Engine.php +++ b/Crypt/GPG/Engine.php @@ -1510,7 +1510,7 @@ private function _openSubprocess() $agentDescriptorSpec, $this->_agentPipes, null, - $env, + array_filter($env, 'is_scalar'), array('binary_pipes' => true) ); @@ -1663,7 +1663,7 @@ private function _openSubprocess() $descriptorSpec, $this->_pipes, null, - $env, + array_filter($env, 'is_scalar'), array('binary_pipes' => true) );