diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2010-01-15 19:26:15 +0100 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2010-01-15 19:46:55 +0100 |
commit | 81b9770727e217e207235c2dc3643a0559fdfd80 (patch) | |
tree | 3437615a4235159193ef0b1ff32a4c2192b0de4f /phpfspot.class.php | |
parent | 0b7778c4ade123b52da9ed4e723330a74e3b10c5 (diff) |
issue #316 makes it necessary to urldecode F-Spots photo uri, fixes #317
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r-- | phpfspot.class.php | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index a69cdde..e220a7c 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -559,6 +559,10 @@ class PHPFSPOT { if($this->dbver < 9) { $row['uri'] = "file://". $row['directory_path'] ."/". $row['name']; } + /* starting with dbversion >= 17 we need to rawurldecode() uri */ + elseif($this->dbver >= 17) { + $row['uri'] = rawurldecode($row['uri']); + } /* if version-idx has not yet been set, get the latest photo version */ if(!isset($version_idx) || !$this->is_valid_version($idx, $version_idx)) @@ -600,7 +604,7 @@ class PHPFSPOT { version_id LIKE '". $version_idx ."'")) { $row['name'] = $version['name']; - $row['uri'] = $version['uri']; + $row['uri'] = rawurldecode($version['uri']); } } } @@ -3500,23 +3504,24 @@ class PHPFSPOT { */ public function parse_uri($uri, $mode) { - if(($components = parse_url($uri)) !== false) { + if(($components = parse_url($uri)) === false) + return $uri; - switch($mode) { - case 'filename': - return basename($components['path']); - break; - case 'dirname': - return dirname($components['path']); - break; - case 'fullpath': - return $components['path']; - break; - } + switch($mode) { + case 'filename': + return basename($components['path']); + break; + case 'dirname': + return dirname($components['path']); + break; + case 'fullpath': + return $components['path']; + break; + default: + $this->throwError("unknown mode ". $mode); + break; } - return $uri; - } // parse_uri() /** |