summaryrefslogtreecommitdiff
path: root/modules/exif/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-04-05 04:07:18 +0000
committerBharat Mediratta <bharat@menalto.com>2009-04-05 04:07:18 +0000
commitfabb9fb4bd0a3dacee7f0b45903987e1e1a4c6bd (patch)
tree3c3423511dc494b027ea6e4abf672e98160ac190 /modules/exif/helpers
parent846fc51f612997efbee1e5a0d05b773b5a4c7f73 (diff)
Don't try to insert exif keys if there aren't any.
Diffstat (limited to 'modules/exif/helpers')
-rw-r--r--modules/exif/helpers/exif.php8
1 files changed, 5 insertions, 3 deletions
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();