aboutsummaryrefslogtreecommitdiffstats
path: root/include/photos.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-07-17 19:42:30 -0700
committerzotlabs <mike@macgirvin.com>2017-07-17 19:42:30 -0700
commit0d062251b6c38a71932e9875cdd777afdfff140b (patch)
tree27a486747bcf82a9c0fe6f8b6a8ca3c6f6682887 /include/photos.php
parentecb1515e5d6cd854bd64444b9c07af50df370efb (diff)
downloadvolse-hubzilla-0d062251b6c38a71932e9875cdd777afdfff140b.tar.gz
volse-hubzilla-0d062251b6c38a71932e9875cdd777afdfff140b.tar.bz2
volse-hubzilla-0d062251b6c38a71932e9875cdd777afdfff140b.zip
fix for bug 827 to provide partial backward compatibility with album names in photo items from < hubzilla 2.4
this will only work part of the time - which is why the behaviour was changed
Diffstat (limited to 'include/photos.php')
-rw-r--r--include/photos.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/photos.php b/include/photos.php
index 6ea444e2e..b4cc89502 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -593,6 +593,15 @@ function photos_album_exists($channel_id, $observer_hash, $album) {
intval($channel_id)
);
+ // partial backward compatibility with Hubzilla < 2.4 when we used the filename only
+ // (ambiguous which would get chosen if you had two albums of the same name in different directories)
+
+ if(! $r) {
+ $r = q("SELECT folder, hash, is_dir, filename, os_path, display_path FROM attach WHERE filename = '%s' AND is_dir = 1 AND uid = %d $sql_extra limit 1",
+ dbesc(hex2bin($album)),
+ intval($channel_id)
+ );
+
return (($r) ? $r[0] : false);
}