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,9 +114,13 @@ class TimelineWrite
$exifJson = json_encode($exif);
// Store error if data > 64kb
if (\is_string($exifJson)) {
if (\strlen($exifJson) > 65535) {
$exifJson = json_encode(['error' => 'Exif data too large']);
}
} else {
$exifJson = json_encode(['error' => 'Exif data encoding error']);
}
if ($prevRow) {
// Update existing row