From 277388b23d6154e0dcc575532f6a8e36622c5e70 Mon Sep 17 00:00:00 2001 From: realcc Date: Sun, 13 Sep 2020 20:50:01 +0700 Subject: [PATCH] Fix Incomplete JSON Blob Export Apply bin2hex when exporting table that contains blob column Signed-off-by: Andreas Kurniawan --- libraries/classes/Plugins/Export/ExportJson.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/classes/Plugins/Export/ExportJson.php b/libraries/classes/Plugins/Export/ExportJson.php index a89918f77f..8dec8a0eb9 100644 --- a/libraries/classes/Plugins/Export/ExportJson.php +++ b/libraries/classes/Plugins/Export/ExportJson.php @@ -20,6 +20,7 @@ use function bin2hex; use function explode; use function json_encode; use function stripslashes; +use function strpos; /** * Handles the export for the JSON format @@ -268,8 +269,8 @@ class ExportJson extends ExportPlugin $data = []; for ($i = 0; $i < $columns_cnt; $i++) { - if ($fieldsMeta[$i]->type === 'geometry') { - // export GIS types as hex + if ($fieldsMeta[$i]->type === 'geometry' || strpos($fieldsMeta[$i]->type, 'blob') !== false) { + // export GIS and blob types as hex $record[$i] = '0x' . bin2hex($record[$i]); } $data[$columns[$i]] = $record[$i];