write: check encoded json (fix #220)

pull/231/head
Varun Patil 2022-11-21 01:43:17 -08:00
parent ed500dce9d
commit 9e91d1d435
1 changed files with 6 additions and 2 deletions

View File

@ -114,8 +114,12 @@ class TimelineWrite
$exifJson = json_encode($exif); $exifJson = json_encode($exif);
// Store error if data > 64kb // Store error if data > 64kb
if (\strlen($exifJson) > 65535) { if (\is_string($exifJson)) {
$exifJson = json_encode(['error' => 'Exif data too large']); if (\strlen($exifJson) > 65535) {
$exifJson = json_encode(['error' => 'Exif data too large']);
}
} else {
$exifJson = json_encode(['error' => 'Exif data encoding error']);
} }
if ($prevRow) { if ($prevRow) {