From 113aff42e609063d5dcf8fb16b6a30baf6e19de9 Mon Sep 17 00:00:00 2001 From: frankdelange Date: Thu, 12 Feb 2015 23:49:02 +0100 Subject: [PATCH] Forcibly trim 'description' field to <2048 (using 2044) characters, otherwise postgresql is unhappy... --- files_opds/lib/meta.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files_opds/lib/meta.php b/files_opds/lib/meta.php index f878674..5b763be 100644 --- a/files_opds/lib/meta.php +++ b/files_opds/lib/meta.php @@ -93,7 +93,7 @@ class Meta $meta['publisher'], $meta['isbn'], $meta['copyright'], - $meta['description'], + mb_strimwidth($meta['description'],0,2044,'...'), $meta['subjects'], $meta['cover'], $meta['rescan'], @@ -112,7 +112,7 @@ class Meta $meta['publisher'], $meta['isbn'], $meta['copyright'], - $meta['description'], + mb_strimwidth($meta['description'],0,2044,'...'), $meta['subjects'], $meta['cover'], $meta['rescan'] @@ -246,7 +246,7 @@ class Meta $value = trim($value); } - if (!($value == '')) { + if (isset($value) && !($value == '')) { switch ($key) { case 'Title': $meta['title'] = $value;