From 6e1159a600b520863e6eb9fffcf09211cbcc6c90 Mon Sep 17 00:00:00 2001 From: d-enk Date: Tue, 12 Mar 2024 17:33:57 +0300 Subject: [PATCH] fix: deep wrapping binary string in array/map tuple fields --- php/Job/Space/Select.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/Job/Space/Select.php b/php/Job/Space/Select.php index 50ad150..34c4cb6 100644 --- a/php/Job/Space/Select.php +++ b/php/Job/Space/Select.php @@ -76,12 +76,12 @@ public function run(): array } if (!json_encode($data)) { - foreach ($data as $i => $tuple) { - foreach ($tuple as $k => $v) { + foreach ($data as $i => &$tuple) { + array_walk_recursive($tuple, function (&$v) { if (is_string($v) && !json_encode($v)) { - $data[$i][$k] = '!!binary ' . base64_encode($v); + $v = '!!binary ' . base64_encode($v); } - } + }); } }