From fabb9fb4bd0a3dacee7f0b45903987e1e1a4c6bd Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 5 Apr 2009 04:07:18 +0000 Subject: Don't try to insert exif keys if there aren't any. --- modules/exif/helpers/exif.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/exif/helpers') diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php index 92b43df7..9bdbc172 100644 --- a/modules/exif/helpers/exif.php +++ b/modules/exif/helpers/exif.php @@ -59,9 +59,11 @@ class exif_Core { // ORM and Database::insert() do not handle inserting multiple rows at once, so do it // the hard way. - $query = "INSERT INTO {exif_keys} (`item_id`, `name`, `value`) VALUES" . - join(",", $data); - $db->query($query); + if ($data) { + $query = "INSERT INTO {exif_keys} (`item_id`, `name`, `value`) VALUES" . + join(",", $data); + $db->query($query); + } } $record = ORM::factory("exif_record")->where("item_id", $item->id)->find(); -- cgit v1.2.3