summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpfspot.class.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 11b5292..4acb647 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -533,24 +533,24 @@ class PHPFSPOT {
if(!isset($version_idx) || !$this->is_valid_version($idx, $version_idx))
$version_idx = $this->get_latest_version($idx);
- /* if an alternative version has been requested */
- if($version_idx > 0) {
-
+ /* if an alternative version has been requested. But we
+ support this only for F-Spot database versions from
+ v9.
+ */
+ if($version_idx > 0 && $this->dbver >= 9) {
/* check for alternative versions */
if($version = $this->db->db_fetchSingleRow("
- SELECT
- version_id, name, uri
- FROM
- photo_versions
- WHERE
- photo_id LIKE '". $idx ."'
- AND
- version_id LIKE '". $version_idx ."'
- ")) {
+ SELECT
+ version_id, name, uri
+ FROM
+ photo_versions
+ WHERE
+ photo_id LIKE '". $idx ."'
+ AND
+ version_id LIKE '". $version_idx ."'")) {
$row['name'] = $version['name'];
$row['uri'] = $version['uri'];
-
}
}