Skip to content

Commit

Permalink
write: check encoded json (fix #220)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Nov 21, 2022
1 parent ed500dc commit 9e91d1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Db/TimelineWrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ public function processFile(
$exifJson = json_encode($exif);

// Store error if data > 64kb
if (\strlen($exifJson) > 65535) {
$exifJson = json_encode(['error' => 'Exif data too large']);
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) {
Expand Down

0 comments on commit 9e91d1d

Please sign in to comment.