diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-04-05 04:07:18 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-04-05 04:07:18 +0000 |
commit | fabb9fb4bd0a3dacee7f0b45903987e1e1a4c6bd (patch) | |
tree | 3c3423511dc494b027ea6e4abf672e98160ac190 /modules/exif/helpers/exif.php | |
parent | 846fc51f612997efbee1e5a0d05b773b5a4c7f73 (diff) |
Don't try to insert exif keys if there aren't any.
Diffstat (limited to 'modules/exif/helpers/exif.php')
-rw-r--r-- | modules/exif/helpers/exif.php | 8 |
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(); |